diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index 357cbf3f152..3bd6a0fe43a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -1864,8 +1864,8 @@ public class ResourceManager extends CompositeService confStore.initialize(conf, conf, rmContext); confStore.format(); } else { - System.out.println("Scheduler Configuration format only " + - "supported by MutableConfScheduler."); + System.out.println(String.format("Scheduler Configuration format only " + + "supported by %s.", MutableConfScheduler.class.getSimpleName())); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java index 1dac043ae16..26c921796b3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java @@ -2678,7 +2678,7 @@ public class RMWebServices extends WebServices implements RMWebServiceProtocol { } else { return Response.status(Status.BAD_REQUEST) .entity("Scheduler Configuration format only supported by " + - "MutableConfScheduler.").build(); + MutableConfScheduler.class.getSimpleName()).build(); } } @@ -2727,8 +2727,8 @@ public class RMWebServices extends WebServices implements RMWebServiceProtocol { .build(); } } else { - String errorMsg = "Configuration change validation only supported by " + - "MutableConfScheduler."; + String errorMsg = String.format("Configuration change validation only supported by %s.", + MutableConfScheduler.class.getSimpleName()); LOG.warn(errorMsg); return Response.status(Status.BAD_REQUEST) .entity(errorMsg) @@ -2823,10 +2823,11 @@ public class RMWebServices extends WebServices implements RMWebServiceProtocol { .build(); } else { return Response.status(Status.BAD_REQUEST).entity( - "This API only supports to retrieve scheduler configuration" - + " from a mutable-conf scheduler, underneath scheduler " - + scheduler.getClass().getSimpleName() - + " is not an instance of MutableConfScheduler") + String.format("This API only supports to retrieve scheduler configuration" + + " from a mutable-conf scheduler, underneath scheduler %s" + + " is not an instance of %s", + scheduler.getClass().getSimpleName(), + MutableConfScheduler.class.getSimpleName())) .build(); } } @@ -2858,8 +2859,8 @@ public class RMWebServices extends WebServices implements RMWebServiceProtocol { } } else { return Response.status(Status.BAD_REQUEST) - .entity("Configuration Version only supported by " - + "MutableConfScheduler.").build(); + .entity(String.format("Configuration Version only supported by %s.", + MutableConfScheduler.class.getSimpleName())).build(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java index d5d534395b5..ce9de643744 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java @@ -75,6 +75,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.*; import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppMetrics; +import org.apache.hadoop.yarn.server.resourcemanager.scheduler.MutableConfScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; @@ -1003,8 +1004,8 @@ public class TestRMWebServices extends JerseyTestBase { Assert.assertEquals(Status.BAD_REQUEST .getStatusCode(), response.getStatus()); Assert.assertTrue(response.getEntity().toString() - .contains("Configuration change validation only supported by" - +" MutableConfScheduler.")); + .contains(String.format("Configuration change validation only supported by %s.", + MutableConfScheduler.class.getSimpleName()))); } @Test