K0K0V0K commented on code in PR #8641:
URL: https://github.com/apache/hadoop/pull/8641#discussion_r3727078602
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfigValidator.java:
##########
@@ -114,6 +120,62 @@ public static void validateVCores(Configuration conf) {
}
}
+ /**
+ * Validates that queue's partition capacity could only be configured if the
queue is accessible by that label
+ * and vice versa, the label that is accessible by the queue could not be
removed if
+ * it has capacity or max-capacity configured in queue's partition
+ *
+ * @param conf Capacity Scheduler configuration to validate
+ * @throws IOException when the above rules have been violated
+ */
+ public static void validateQueueAccessibleLabels(Configuration conf) throws
IOException {
+ CapacitySchedulerConfiguration csConf = new
CapacitySchedulerConfiguration(conf);
+
+ for (String queuePath : csConf.getConfiguredNodeLabelsByQueue().keySet()) {
+ QueuePath queue = new QueuePath(queuePath);
+ if (queue.isRoot()) {
+ continue;
+ }
+
+ for (String label : csConf.getConfiguredNodeLabels(queue)) {
+ if (RMNodeLabelsManager.NO_LABEL.equals(label)
+ || !hasQueuePartitionCapacity(csConf, queue, label)
+ || isLabelAccessibleByQueue(csConf, queue, label)) {
+ continue;
+ }
+
+ throw new IOException("Queue: " + queuePath + " must have
accessible-node-labels and its capacity together");
Review Comment:
IOException is the right class here?
--
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]