Hean-Chhinling commented on code in PR #8845:
URL: https://github.com/apache/hadoop/pull/8845#discussion_r4421896912


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/resolver/QueueProperties.java:
##########
@@ -0,0 +1,950 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.resolver;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.regex.Matcher;
+
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.yarn.api.records.Priority;
+import org.apache.hadoop.yarn.api.records.QueueState;
+import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.hadoop.yarn.api.records.ResourceInformation;
+import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
+import 
org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AppPriorityACLConfigurationParser;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AppPriorityACLGroup;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AutoCreatedQueueTemplate;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacityVector;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.QueueCapacityConfigParser;
+import 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.resolver.QueueProperty.Kind;
+import org.apache.hadoop.yarn.util.UnitsConversionUtil;
+import org.apache.hadoop.yarn.util.resource.ResourceUtils;
+import org.apache.hadoop.yarn.util.resource.Resources;
+import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration.*;
+
+/**
+ * One {@link QueueProperty} per per-queue configuration key of the Capacity
+ * Scheduler, and the parse rules they share with the
+ * {@code CapacitySchedulerConfiguration} getters.
+ * <p>
+ * A property that takes an argument documents it; {@code null} selects the
+ * default the queues use. Readers mirror the getters exactly, including
+ * which fallback keys are read before the queue key, so that the getters can
+ * delegate to them without changing values, exception types or messages.
+ */
[email protected]
[email protected]
+public final class QueueProperties {
+  /**
+   * The readers log under the loggers of the code they replace, so log
+   * output and log based tests stay the same.
+   */
+  private static final Logger LOG =
+      LoggerFactory.getLogger(CapacitySchedulerConfiguration.class);
+  private static final Logger CONF_LOG =
+      LoggerFactory.getLogger(Configuration.class);
+
+  private static final String WEIGHT_SUFFIX = "w";
+  private static final QueueCapacityConfigParser CAPACITY_PARSER =
+      CapacitySchedulerConfiguration.getQueueCapacityConfigParser();
+  private static final AppPriorityACLConfigurationParser PRIORITY_ACL_PARSER =
+      new AppPriorityACLConfigurationParser();
+  /** The resource types the queues pass to the absolute resource parser. */
+  public static final Set<String> QUEUE_RESOURCE_TYPES =
+      ImmutableSet.of("memory", "vcores");
+  /** Key of the scheduler-wide maximum-queue-depth fallback. */
+  public static final String GLOBAL_MAXIMUM_QUEUE_DEPTH =
+      PREFIX + MAXIMUM_QUEUE_DEPTH;
+  /** Key of the scheduler-wide multi-node sorting policy fallback. */
+  public static final String GLOBAL_MULTI_NODE_SORTING_POLICY =
+      MULTI_NODE_SORTING_POLICY_NAME;
+
+  /** The kinds of configured queues. */
+  private static final Set<Kind> ALL =
+      EnumSet.of(Kind.ROOT, Kind.PARENT, Kind.LEAF, Kind.PLAN);
+  /**
+   * Every kind, ReservationQueue included; a ReservationQueue sets up every
+   * value except its capacities, which come from its entitlement.
+   */
+  private static final Set<Kind> SET_UP = EnumSet.allOf(Kind.class);
+  private static final Set<Kind> PARENTS = EnumSet.of(Kind.ROOT, Kind.PARENT);
+  /** Queues set up as parent queue objects, PlanQueue included. */
+  private static final Set<Kind> PARENT_OBJECTS =
+      EnumSet.of(Kind.ROOT, Kind.PARENT, Kind.PLAN);
+  private static final Set<Kind> LEAVES =
+      EnumSet.of(Kind.LEAF, Kind.PLAN, Kind.RESERVATION);
+  /** Queues set up as leaf queue objects. */
+  private static final Set<Kind> LEAF =
+      EnumSet.of(Kind.LEAF, Kind.RESERVATION);
+  private static final Set<Kind> PLANS = EnumSet.of(Kind.PLAN);
+
+  private QueueProperties() {
+  }
+
+  // P01

Review Comment:
   I see..thank you, Beni!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to