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/dao/CapacitySchedulerInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java index 79d11e2b96..abf53d6395 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java @@ -50,6 +50,7 @@ public class CapacitySchedulerInfo extends SchedulerInfo { protected float normalizedWeight; protected String queueName; private String queuePath; + protected int maxParallelApps; protected CapacitySchedulerQueueInfoList queues; protected QueueCapacitiesInfo capacities; protected CapacitySchedulerHealthInfo health; @@ -83,6 +84,7 @@ public CapacitySchedulerInfo(CSQueue parent, CapacityScheduler cs) { this.maxCapacity = max * 100; this.weight = parent.getQueueCapacities().getWeight(); this.normalizedWeight = parent.getQueueCapacities().getNormalizedWeight(); + this.maxParallelApps = parent.getMaxParallelApps(); capacities = new QueueCapacitiesInfo(parent.getQueueCapacities(), parent.getQueueResourceQuotas(), false); 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/TestRMWebServicesCapacitySched.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java index d4e7ca63f2..e9df9d3485 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java @@ -270,7 +270,8 @@ public void verifyClusterSchedulerXML(NodeList nodes) throws Exception { WebServicesTestUtils.getXmlFloat(element, "capacity"), WebServicesTestUtils.getXmlFloat(element, "maxCapacity"), WebServicesTestUtils.getXmlString(element, "queueName"), - WebServicesTestUtils.getXmlString(element, "queuePath")); + WebServicesTestUtils.getXmlString(element, "queuePath"), + WebServicesTestUtils.getXmlInt(element, "maxParallelApps")); NodeList children = element.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { @@ -374,13 +375,14 @@ private void verifyClusterScheduler(JSONObject json) throws JSONException, JSONObject info = json.getJSONObject("scheduler"); assertEquals("incorrect number of elements in: " + info, 1, info.length()); info = info.getJSONObject("schedulerInfo"); - assertEquals("incorrect number of elements in: " + info, 22, info.length()); + assertEquals("incorrect number of elements in: " + info, 23, info.length()); verifyClusterSchedulerGeneric(info.getString("type"), (float) info.getDouble("usedCapacity"), (float) info.getDouble("capacity"), (float) info.getDouble("maxCapacity"), info.getString("queueName"), - info.getString("queuePath")); + info.getString("queuePath"), + info.getInt("maxParallelApps")); JSONObject health = info.getJSONObject("health"); assertNotNull(health); assertEquals("incorrect number of elements in: " + health, 3, @@ -415,7 +417,7 @@ private void verifyClusterScheduler(JSONObject json) throws JSONException, } private void verifyClusterSchedulerGeneric(String type, float usedCapacity, - float capacity, float maxCapacity, String queueName, String queuePath) + float capacity, float maxCapacity, String queueName, String queuePath, int maxParallelApps) throws Exception { assertTrue("type doesn't match", "capacityScheduler".matches(type)); @@ -424,6 +426,7 @@ private void verifyClusterSchedulerGeneric(String type, float usedCapacity, assertEquals("maxCapacity doesn't match", 100, maxCapacity, 1e-3f); assertTrue("queueName doesn't match", "root".matches(queueName)); assertTrue("queuePath doesn't match", "root".matches(queuePath)); + assertEquals("maxParallelApps doesn't match ", Integer.MAX_VALUE, maxParallelApps); } private void verifySubQueue(JSONObject info, String q, 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/TestRMWebServicesForCSWithPartitions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java index 36b27a2323..db9cbe6b20 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java @@ -574,7 +574,7 @@ private void verifySchedulerInfoJson(JSONObject json) JSONObject info = json.getJSONObject("scheduler"); assertEquals("incorrect number of elements", 1, info.length()); info = info.getJSONObject("schedulerInfo"); - assertEquals("incorrect number of elements", 22, info.length()); + assertEquals("incorrect number of elements", 23, info.length()); JSONObject capacitiesJsonObject = info.getJSONObject(CAPACITIES); JSONArray partitionsCapsArray = capacitiesJsonObject.getJSONArray(QUEUE_CAPACITIES_BY_PARTITION);