You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by jh...@apache.org on 2020/05/12 17:54:54 UTC
[hadoop] branch branch-2.10 updated: YARN-10260. Allow
transitioning queue from DRAINING to RUNNING state. Contributed by Bilwa S
T
This is an automated email from the ASF dual-hosted git repository.
jhung pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-2.10 by this push:
new b8c88f6 YARN-10260. Allow transitioning queue from DRAINING to RUNNING state. Contributed by Bilwa S T
b8c88f6 is described below
commit b8c88f6968ad4f4b2ce0448561f1cc73f46714ea
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
(cherry picked from commit fff1d2c1226ec23841b04dd478e8b97f31abbeba)
(cherry picked from commit 564d3211f27c35bf3143a4bd1b3f8eeac2c6b01f)
(cherry picked from commit a7ea55e0156299ec8b80af1f3e681a3a7a31a3b4)
(cherry picked from commit b3e9aff5f7bcafea8b82f9b07719ff53d3ab2f12)
---
.../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 0bd2005..aa635c8 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
@@ -1092,10 +1092,6 @@ public abstract class AbstractCSQueue implements CSQueue {
if (getState() == QueueState.RUNNING) {
LOG.info("The specified queue:" + queueName
+ " is already in the RUNNING state.");
- } else if (getState() == QueueState.DRAINING) {
- throw new YarnException(
- "The queue:" + queueName + " 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 9f2933e..7f18426 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
@@ -151,6 +151,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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org