Преглед изворни кода

YARN-8678. Queue Management API - rephrase error messages. Contributed by Prabhu Joseph.

Abhishek Modi пре 5 година
родитељ
комит
c7ef4fb74a

+ 2 - 2
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 @@ public abstract class AbstractCSQueue implements CSQueue {
             && 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);
         }

+ 3 - 3
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 @@ public class CapacitySchedulerQueueManager implements SchedulerQueueManager<
             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())) {

+ 2 - 2
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 class TestQueueState {
       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."));
     }
   }