tomicooler commented on a change in pull request #3403:
URL: https://github.com/apache/hadoop/pull/3403#discussion_r705957131
##########
File path:
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
##########
@@ -125,76 +133,107 @@ public static void validateQueueHierarchy(
CapacitySchedulerConfiguration newConf) throws IOException {
// check that all static queues are included in the newQueues list
for (CSQueue oldQueue : queues.getQueues()) {
- if (!(AbstractAutoCreatedLeafQueue.class.isAssignableFrom(
- oldQueue.getClass()))) {
- String queuePath = oldQueue.getQueuePath();
- CSQueue newQueue = newQueues.get(queuePath);
- String configPrefix = newConf.getQueuePrefix(
- oldQueue.getQueuePath());
- String state = newConf.get(configPrefix + "state");
- QueueState newQueueState = null;
- if (state != null) {
- try {
- newQueueState = QueueState.valueOf(state);
- } catch (Exception ex) {
- LOG.warn("Not a valid queue state for queue "
- + oldQueue.getQueuePath());
+ if
(AbstractAutoCreatedLeafQueue.class.isAssignableFrom(oldQueue.getClass())) {
+ continue;
+ }
+
+ final String queuePath = oldQueue.getQueuePath();
+ final String configPrefix =
CapacitySchedulerConfiguration.getQueuePrefix(
+ oldQueue.getQueuePath());
+ final QueueState newQueueState = getQueueState(oldQueue,
newConf.get(configPrefix + "state"));
+ final CSQueue newQueue = newQueues.get(queuePath);
+
+ if (null == newQueue) {
+ // old queue doesn't exist in the new XML
+ if (oldQueue.getState() == QueueState.STOPPED || newQueueState ==
QueueState.STOPPED) {
Review comment:
Good catch, extracted to a helper function.
--
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]