From b871e267be1b4fd2367d9b9bc390eb4d0ddb6fa5 Mon Sep 17 00:00:00 2001 From: Prabhu Joseph Date: Sun, 25 Aug 2019 18:44:18 +0530 Subject: [PATCH] YARN-8678. Queue Management API - rephrase error messages. --- .../server/resourcemanager/scheduler/capacity/AbstractCSQueue.java | 4 ++-- .../scheduler/capacity/CapacitySchedulerQueueManager.java | 6 +++--- .../server/resourcemanager/scheduler/capacity/TestQueueState.java | 4 ++-- 3 files changed, 7 insertions(+), 7 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 21c385a..3ae22ad 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 @@ -629,8 +629,8 @@ private void initializeQueueState(QueueState previousState, && parentState != QueueState.RUNNING) { throw new IllegalArgumentException( "The parent queue:" + parent.getQueueName() - + " state is STOPPED, child queue:" + queueName - + " state cannot be RUNNING."); + + " cannot be STOPPED as the child queue:" + queueName + + " is in RUNNING state."); } else { updateQueueState(configuredState); } 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/CapacitySchedulerQueueManager.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/CapacitySchedulerQueueManager.java index cdde25d..3d54820 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/CapacitySchedulerQueueManager.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/CapacitySchedulerQueueManager.java @@ -323,9 +323,9 @@ private void validateQueueHierarchy(Map queues, LOG.info("Deleting Queue " + queueName + ", as it is not" + " present in the modified capacity configuration xml"); } else{ - throw new IOException(oldQueue.getQueuePath() + " is deleted from" - + " the new capacity scheduler configuration, but the" - + " queue is not yet in stopped state. " + "Current State : " + throw new IOException(oldQueue.getQueuePath() + " cannot be" + + " deleted from the capacity scheduler configuration, as" + + " the queue is not yet in stopped state. " + "Current State : " + oldQueue.getState()); } } else if (!oldQueue.getQueuePath().equals(newQueue.getQueuePath())) { 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 e671ed6..c9980ce 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 @@ -109,8 +109,8 @@ public void testQueueState() throws IOException { Assert.fail("Should throw an Exception."); } catch (Exception ex) { Assert.assertTrue(ex.getCause().getMessage().contains( - "The parent queue:q1 state is STOPPED, " - + "child queue:q2 state cannot be RUNNING.")); + "The parent queue:q1 cannot be STOPPED as the child" + + " queue:q2 is in RUNNING state.")); } } -- 2.7.4 (Apple Git-66)