This is an automated email from the ASF dual-hosted git repository. jhung pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new fff1d2c YARN-10260. Allow transitioning queue from DRAINING to RUNNING state. Contributed by Bilwa S T fff1d2c is described below commit fff1d2c1226ec23841b04dd478e8b97f31abbeba Author: Jonathan Hung <jh...@linkedin.com> AuthorDate: Tue May 12 10:48:54 2020 -0700 YARN-10260. Allow transitioning queue from DRAINING to RUNNING state. Contributed by Bilwa S T --- .../scheduler/capacity/AbstractCSQueue.java | 4 ---- .../scheduler/capacity/TestQueueState.java | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java index bcb255e..0a4a14f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/AbstractCSQueue.java @@ -1359,10 +1359,6 @@ public abstract class AbstractCSQueue implements CSQueue { if (getState() == QueueState.RUNNING) { LOG.info("The specified queue:" + getQueuePath() + " is already in the RUNNING state."); - } else if (getState() == QueueState.DRAINING) { - throw new YarnException( - "The queue:" + getQueuePath() + " is in the Stopping process. " - + "Please wait for the queue getting fully STOPPED."); } else { CSQueue parent = getParent(); if (parent == null || parent.getState() == QueueState.RUNNING) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueState.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueState.java index 9997335..13957e9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueState.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueState.java @@ -157,6 +157,23 @@ public class TestQueueState { Assert.assertEquals(QueueState.DRAINING, cs.getQueue(Q2).getState()); Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q3).getState()); + // set Q2 state to RUNNING and do reinitialize. + // Q2 should transit from DRAINING to RUNNING + csConf.setState(Q2_PATH, QueueState.RUNNING); + conf = new YarnConfiguration(csConf); + cs.reinitialize(conf, rmContext); + Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q1).getState()); + Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q2).getState()); + Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q3).getState()); + + // set Q2 state to stop and do reinitialize. + csConf.setState(Q2_PATH, QueueState.STOPPED); + conf = new YarnConfiguration(csConf); + cs.reinitialize(conf, rmContext); + Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q1).getState()); + Assert.assertEquals(QueueState.DRAINING, cs.getQueue(Q2).getState()); + Assert.assertEquals(QueueState.RUNNING, cs.getQueue(Q3).getState()); + // set Q1 state to stop and do reinitialize. csConf.setState(Q1_PATH, QueueState.STOPPED); conf = new YarnConfiguration(csConf); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org