Return-Path: X-Original-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A43B59BDD for ; Tue, 3 Apr 2012 20:39:39 +0000 (UTC) Received: (qmail 51361 invoked by uid 500); 3 Apr 2012 20:39:39 -0000 Delivered-To: apmail-hadoop-mapreduce-commits-archive@hadoop.apache.org Received: (qmail 51317 invoked by uid 500); 3 Apr 2012 20:39:39 -0000 Mailing-List: contact mapreduce-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-dev@hadoop.apache.org Delivered-To: mailing list mapreduce-commits@hadoop.apache.org Received: (qmail 51308 invoked by uid 99); 3 Apr 2012 20:39:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 20:39:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 20:39:31 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2738F23888EA; Tue, 3 Apr 2012 20:39:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1309133 - in /hadoop/common/trunk/hadoop-mapreduce-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/ hadoop-yarn/hadoop-yarn-server/hadoop-yarn... Date: Tue, 03 Apr 2012 20:39:08 -0000 To: mapreduce-commits@hadoop.apache.org From: tgraves@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120403203909.2738F23888EA@eris.apache.org> Author: tgraves Date: Tue Apr 3 20:39:08 2012 New Revision: 1309133 URL: http://svn.apache.org/viewvc?rev=1309133&view=rev Log: MAPREDUCE-4020. Web services returns incorrect JSON for deep queue tree (Anupam Seth via tgraves) Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfoList.java Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfo.java hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Tue Apr 3 20:39:08 2012 @@ -237,6 +237,9 @@ Release 0.23.3 - UNRELEASED MAPREDUCE-3999. Tracking link gives an error if the AppMaster hasn't started yet (Ravi Prakash via bobby) + MAPREDUCE-4020. Web services returns incorrect JSON for deep queue tree + (Anupam Seth via tgraves) + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java Tue Apr 3 20:39:08 2012 @@ -100,8 +100,8 @@ class CapacitySchedulerPage extends RmVi @Override public void render(Block html) { ArrayList subQueues = - (csqinfo.qinfo == null) ? csqinfo.csinfo.getSubQueues() - : csqinfo.qinfo.getSubQueues(); + (csqinfo.qinfo == null) ? csqinfo.csinfo.getQueues().getQueueInfoList() + : csqinfo.qinfo.getQueues().getQueueInfoList(); UL ul = html.ul("#pq"); for (CapacitySchedulerQueueInfo info : subQueues) { float used = info.getUsedCapacity() / 100; @@ -122,7 +122,7 @@ class CapacitySchedulerPage extends RmVi _(join(percent(used), " used"))._(); csqinfo.qinfo = info; - if (info.getSubQueues() == null) { + if (info.getQueues() == null) { li.ul("#lq").li()._(LeafQueueInfoBlock.class)._()._(); } else { li._(QueueBlock.class); Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java Tue Apr 3 20:39:08 2012 @@ -34,6 +34,7 @@ import org.apache.hadoop.yarn.server.res import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppsInfo; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerInfo; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerQueueInfo; +import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerQueueInfoList; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterInfo; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterMetricsInfo; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FifoSchedulerInfo; @@ -57,7 +58,7 @@ public class JAXBContextResolver impleme SchedulerTypeInfo.class, NodeInfo.class, UserMetricsInfo.class, CapacitySchedulerInfo.class, ClusterMetricsInfo.class, SchedulerInfo.class, AppsInfo.class, NodesInfo.class, - RemoteExceptionData.class}; + RemoteExceptionData.class, CapacitySchedulerQueueInfoList.class}; public JAXBContextResolver() throws Exception { this.types = new HashSet(Arrays.asList(cTypes)); Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerInfo.java Tue Apr 3 20:39:08 2012 @@ -18,8 +18,6 @@ package org.apache.hadoop.yarn.server.resourcemanager.webapp.dao; -import java.util.ArrayList; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -38,7 +36,7 @@ public class CapacitySchedulerInfo exten protected float usedCapacity; protected float maxCapacity; protected String queueName; - protected ArrayList queues; + protected CapacitySchedulerQueueInfoList queues; @XmlTransient static final float EPSILON = 1e-8f; @@ -74,22 +72,22 @@ public class CapacitySchedulerInfo exten return this.queueName; } - public ArrayList getSubQueues() { + public CapacitySchedulerQueueInfoList getQueues() { return this.queues; } - protected ArrayList getQueues(CSQueue parent) { + protected CapacitySchedulerQueueInfoList getQueues(CSQueue parent) { CSQueue parentQueue = parent; - ArrayList queuesInfo = new ArrayList(); + CapacitySchedulerQueueInfoList queuesInfo = new CapacitySchedulerQueueInfoList(); for (CSQueue queue : parentQueue.getChildQueues()) { CapacitySchedulerQueueInfo info; if (queue instanceof LeafQueue) { info = new CapacitySchedulerLeafQueueInfo((LeafQueue)queue); } else { info = new CapacitySchedulerQueueInfo(queue); - info.subQueues = getQueues(queue); + info.queues = getQueues(queue); } - queuesInfo.add(info); + queuesInfo.addToQueueInfoList(info); } return queuesInfo; } Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfo.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfo.java?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfo.java (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfo.java Tue Apr 3 20:39:08 2012 @@ -17,8 +17,6 @@ */ package org.apache.hadoop.yarn.server.resourcemanager.webapp.dao; -import java.util.ArrayList; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -49,7 +47,7 @@ public class CapacitySchedulerQueueInfo protected String usedResources; protected String queueName; protected QueueState state; - protected ArrayList subQueues; + protected CapacitySchedulerQueueInfoList queues; CapacitySchedulerQueueInfo() { }; @@ -117,8 +115,8 @@ public class CapacitySchedulerQueueInfo return this.queuePath; } - public ArrayList getSubQueues() { - return this.subQueues; + public CapacitySchedulerQueueInfoList getQueues() { + return this.queues; } /** Added: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfoList.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfoList.java?rev=1309133&view=auto ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfoList.java (added) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/CapacitySchedulerQueueInfoList.java Tue Apr 3 20:39:08 2012 @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.yarn.server.resourcemanager.webapp.dao; + +import java.util.ArrayList; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +@XmlAccessorType(XmlAccessType.FIELD) +public class CapacitySchedulerQueueInfoList { + protected ArrayList queue; + + public CapacitySchedulerQueueInfoList() { + queue = new ArrayList(); + } + + public ArrayList getQueueInfoList() { + return this.queue; + } + + public boolean addToQueueInfoList(CapacitySchedulerQueueInfo e) { + return this.queue.add(e); + } + + public CapacitySchedulerQueueInfo getQueueInfo(int i) { + return this.queue.get(i); + } +} Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java Tue Apr 3 20:39:08 2012 @@ -151,7 +151,12 @@ public class TestRMWebServicesCapacitySc conf.setUserLimitFactor(B2, 100.0f); conf.setCapacity(B3, 20); conf.setUserLimitFactor(B3, 100.0f); - + + conf.setQueues(A1, new String[] {"a1a", "a1b"}); + final String A1A = A1 + ".a1a"; + conf.setCapacity(A1A, 85); + final String A1B = A1 + ".a1b"; + conf.setCapacity(A1B, 15); } @Before @@ -232,12 +237,18 @@ public class TestRMWebServicesCapacitySc WebServicesTestUtils.getXmlFloat(element, "maxCapacity"), WebServicesTestUtils.getXmlString(element, "queueName")); - NodeList queues = element.getElementsByTagName("queues"); - for (int j = 0; j < queues.getLength(); j++) { - Element qElem = (Element) queues.item(j); - String qName = WebServicesTestUtils.getXmlString(qElem, "queueName"); - String q = CapacitySchedulerConfiguration.ROOT + "." + qName; - verifySubQueueXML(qElem, q, 100, 100); + NodeList children = element.getChildNodes(); + for (int j = 0; j < children.getLength(); j++) { + Element qElem = (Element) children.item(j); + if(qElem.getTagName().equals("queues")) { + NodeList qListInfos = qElem.getChildNodes(); + for (int k = 0; k < qListInfos.getLength(); k++) { + Element qElem2 = (Element) qListInfos.item(k); + String qName2 = WebServicesTestUtils.getXmlString(qElem2, "queueName"); + String q2 = CapacitySchedulerConfiguration.ROOT + "." + qName2; + verifySubQueueXML(qElem2, q2, 100, 100); + } + } } } } @@ -245,8 +256,18 @@ public class TestRMWebServicesCapacitySc public void verifySubQueueXML(Element qElem, String q, float parentAbsCapacity, float parentAbsMaxCapacity) throws Exception { - NodeList queues = qElem.getElementsByTagName("subQueues"); - QueueInfo qi = (queues != null) ? new QueueInfo() : new LeafQueueInfo(); + NodeList children = qElem.getChildNodes(); + boolean hasSubQueues = false; + for (int j = 0; j < children.getLength(); j++) { + Element qElem2 = (Element) children.item(j); + if(qElem2.getTagName().equals("queues")) { + NodeList qListInfos = qElem2.getChildNodes(); + if (qListInfos.getLength() > 0) { + hasSubQueues = true; + } + } + } + QueueInfo qi = (hasSubQueues) ? new QueueInfo() : new LeafQueueInfo(); qi.capacity = WebServicesTestUtils.getXmlFloat(qElem, "capacity"); qi.usedCapacity = WebServicesTestUtils.getXmlFloat(qElem, "usedCapacity"); @@ -263,14 +284,18 @@ public class TestRMWebServicesCapacitySc qi.queueName = WebServicesTestUtils.getXmlString(qElem, "queueName"); qi.state = WebServicesTestUtils.getXmlString(qElem, "state"); verifySubQueueGeneric(q, qi, parentAbsCapacity, parentAbsMaxCapacity); - - if (queues != null) { - for (int j = 0; j < queues.getLength(); j++) { - Element subqElem = (Element) queues.item(j); - String qName = WebServicesTestUtils.getXmlString(subqElem, "queueName"); - String q2 = q + "." + qName; - verifySubQueueXML(subqElem, q2, - qi.absoluteCapacity, qi.absoluteMaxCapacity); + if (hasSubQueues) { + for (int j = 0; j < children.getLength(); j++) { + Element qElem2 = (Element) children.item(j); + if(qElem2.getTagName().equals("queues")) { + NodeList qListInfos = qElem2.getChildNodes(); + for (int k = 0; k < qListInfos.getLength(); k++) { + Element qElem3 = (Element) qListInfos.item(k); + String qName3 = WebServicesTestUtils.getXmlString(qElem3, "queueName"); + String q3 = q + "." + qName3; + verifySubQueueXML(qElem3, q3, qi.absoluteCapacity, qi.absoluteMaxCapacity); + } + } } } else { LeafQueueInfo lqi = (LeafQueueInfo) qi; @@ -307,7 +332,7 @@ public class TestRMWebServicesCapacitySc (float) info.getDouble("capacity"), (float) info.getDouble("maxCapacity"), info.getString("queueName")); - JSONArray arr = info.getJSONArray("queues"); + JSONArray arr = info.getJSONObject("queues").getJSONArray("queue"); assertEquals("incorrect number of elements", 2, arr.length()); // test subqueues @@ -333,7 +358,7 @@ public class TestRMWebServicesCapacitySc throws JSONException, Exception { int numExpectedElements = 11; boolean isParentQueue = true; - if (!info.has("subQueues")) { + if (!info.has("queues")) { numExpectedElements = 20; isParentQueue = false; } @@ -354,7 +379,7 @@ public class TestRMWebServicesCapacitySc verifySubQueueGeneric(q, qi, parentAbsCapacity, parentAbsMaxCapacity); if (isParentQueue) { - JSONArray arr = info.getJSONArray("subQueues"); + JSONArray arr = info.getJSONObject("queues").getJSONArray("queue"); // test subqueues for (int i = 0; i < arr.length(); i++) { JSONObject obj = arr.getJSONObject(i); Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm?rev=1309133&r1=1309132&r2=1309133&view=diff ============================================================================== --- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm (original) +++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm Tue Apr 3 20:39:08 2012 @@ -324,7 +324,7 @@ ResourceManager REST API's. | queues | array of queues(JSON)/zero or more queue objects(XML) | A collection of queue resources| *---------------+--------------+-------------------------------+ -** Elements of the queues/subQueues object for a Parent queue +** Elements of the queues object for a Parent queue *---------------+--------------+-------------------------------+ || Item || Data Type || Description | @@ -349,10 +349,10 @@ ResourceManager REST API's. *---------------+--------------+-------------------------------+ | state | string of QueueState | The state of the queue | *---------------+--------------+-------------------------------+ -| subQueues | array of queues(JSON)/zero or more queue objects(XML) | A collection of sub-queue information| +| queues | array of queues(JSON)/zero or more queue objects(XML) | A collection of sub-queue information| *---------------+--------------+-------------------------------+ -** Elements of the queues/subQueues object for a Leaf queue - contains all elements in parent plus the following: +** Elements of the queues object for a Leaf queue - contains all elements in parent plus the following: *---------------+--------------+-------------------------------+ || Item || Data Type || Description | @@ -406,168 +406,190 @@ ResourceManager REST API's. "queueName" : "root", "maxCapacity" : 100, "type" : "capacityScheduler", - "queues" : [ - { - "numPendingApplications" : 0, - "queueName" : "default", - "userLimitFactor" : 1, - "maxApplications" : 7000, - "usedCapacity" : 0, - "numContainers" : 0, - "state" : "RUNNING", - "maxCapacity" : 90, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 90, - "maxActiveApplications" : 1, - "numActiveApplications" : 0, - "absoluteUsedCapacity" : 0, - "userLimit" : 100, - "absoluteCapacity" : 70, - "maxActiveApplicationsPerUser" : 1, - "capacity" : 70, - "type" : "capacitySchedulerLeafQueueInfo", - "maxApplicationsPerUser" : 7000 - }, - { - "queueName" : "test", - "absoluteUsedCapacity" : 0, - "absoluteCapacity" : 20, - "usedCapacity" : 0, - "capacity" : 20, - "subQueues" : [ - { - "numPendingApplications" : 0, - "queueName" : "a1", - "userLimitFactor" : 1, - "maxApplications" : 1200, - "usedCapacity" : 0, - "numContainers" : 0, - "state" : "RUNNING", - "maxCapacity" : 80, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 16.000002, - "maxActiveApplications" : 1, - "numActiveApplications" : 0, - "absoluteUsedCapacity" : 0, - "userLimit" : 100, - "absoluteCapacity" : 12, - "maxActiveApplicationsPerUser" : 1, - "capacity" : 60.000004, - "type" : "capacitySchedulerLeafQueueInfo", - "maxApplicationsPerUser" : 1200 + "queues" : { + "queue" : [ + { + "numPendingApplications" : 0, + "queueName" : "default", + "userLimitFactor" : 1, + "maxApplications" : 1, + "usedCapacity" : 0, + "numContainers" : 0, + "state" : "RUNNING", + "maxCapacity" : 90, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 90, + "maxActiveApplications" : 1, + "numActiveApplications" : 0, + "absoluteUsedCapacity" : 0, + "userLimit" : 100, + "absoluteCapacity" : 70, + "maxActiveApplicationsPerUser" : 1, + "capacity" : 70, + "type" : "capacitySchedulerLeafQueueInfo", + "maxApplicationsPerUser" : 1 + }, + { + "queueName" : "test", + "absoluteCapacity" : 20, + "usedCapacity" : 0, + "capacity" : 20, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 100, + "queues" : { + "queue" : [ + { + "queueName" : "a1", + "absoluteCapacity" : 12, + "usedCapacity" : 0, + "capacity" : 60.000004, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 100, + "queues" : { + "queue" : [ + { + "numPendingApplications" : 0, + "queueName" : "a11", + "userLimitFactor" : 1, + "maxApplications" : 0, + "usedCapacity" : 0, + "numContainers" : 0, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 100, + "maxActiveApplications" : 1, + "numActiveApplications" : 0, + "absoluteUsedCapacity" : 0, + "userLimit" : 100, + "absoluteCapacity" : 10.200001, + "maxActiveApplicationsPerUser" : 1, + "capacity" : 85, + "type" : "capacitySchedulerLeafQueueInfo", + "maxApplicationsPerUser" : 0 + }, + { + "numPendingApplications" : 0, + "queueName" : "a12", + "userLimitFactor" : 1, + "maxApplications" : 0, + "usedCapacity" : 0, + "numContainers" : 0, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 100, + "maxActiveApplications" : 1, + "numActiveApplications" : 0, + "absoluteUsedCapacity" : 0, + "userLimit" : 100, + "absoluteCapacity" : 1.8000001, + "maxActiveApplicationsPerUser" : 1, + "capacity" : 15.000001, + "type" : "capacitySchedulerLeafQueueInfo", + "maxApplicationsPerUser" : 0 + } + ] + }, + "absoluteUsedCapacity" : 0 + }, + { + "numPendingApplications" : 0, + "queueName" : "a2", + "userLimitFactor" : 1, + "maxApplications" : 0, + "usedCapacity" : 0, + "numContainers" : 0, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 100, + "maxActiveApplications" : 1, + "numActiveApplications" : 0, + "absoluteUsedCapacity" : 0, + "userLimit" : 100, + "absoluteCapacity" : 8.000001, + "maxActiveApplicationsPerUser" : 1, + "capacity" : 40, + "type" : "capacitySchedulerLeafQueueInfo", + "maxApplicationsPerUser" : 0 + } + ] }, - { - "numPendingApplications" : 0, - "queueName" : "a2", - "userLimitFactor" : 1, - "maxApplications" : 800, - "usedCapacity" : 0, - "numContainers" : 0, - "state" : "RUNNING", - "maxCapacity" : 100, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 100, - "maxActiveApplications" : 1, - "numActiveApplications" : 0, - "absoluteUsedCapacity" : 0, - "userLimit" : 100, - "absoluteCapacity" : 8.000001, - "maxActiveApplicationsPerUser" : 1, - "capacity" : 40, - "type" : "capacitySchedulerLeafQueueInfo", - "maxApplicationsPerUser" : 800 - } - ], - "state" : "RUNNING", - "maxCapacity" : 80, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 80 - }, - { - "queueName" : "test2", - "absoluteUsedCapacity" : 0, - "absoluteCapacity" : 10, - "usedCapacity" : 0, - "capacity" : 10, - "subQueues" : [ - { - "numPendingApplications" : 0, - "queueName" : "a5", - "userLimitFactor" : 1, - "maxApplications" : 500, - "usedCapacity" : 0, - "numContainers" : 0, - "state" : "RUNNING", - "maxCapacity" : 100, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 100, - "maxActiveApplications" : 1, - "numActiveApplications" : 0, - "absoluteUsedCapacity" : 0, - "userLimit" : 100, - "absoluteCapacity" : 5, - "maxActiveApplicationsPerUser" : 1, - "capacity" : 50, - "type" : "capacitySchedulerLeafQueueInfo", - "maxApplicationsPerUser" : 500 + "absoluteUsedCapacity" : 0 + }, + { + "queueName" : "test2", + "absoluteCapacity" : 10, + "usedCapacity" : 0, + "capacity" : 10, + "state" : "RUNNING", + "maxCapacity" : 15.000001, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 15.000001, + "queues" : { + "queue" : [ + { + "numPendingApplications" : 0, + "queueName" : "a3", + "userLimitFactor" : 1, + "maxApplications" : 0, + "usedCapacity" : 0, + "numContainers" : 0, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 15.000001, + "maxActiveApplications" : 1, + "numActiveApplications" : 0, + "absoluteUsedCapacity" : 0, + "userLimit" : 100, + "absoluteCapacity" : 9, + "maxActiveApplicationsPerUser" : 1, + "capacity" : 90, + "type" : "capacitySchedulerLeafQueueInfo", + "maxApplicationsPerUser" : 0 + }, + { + "numPendingApplications" : 0, + "queueName" : "a4", + "userLimitFactor" : 1, + "maxApplications" : 0, + "usedCapacity" : 0, + "numContainers" : 0, + "state" : "RUNNING", + "maxCapacity" : 100, + "numApplications" : 0, + "usedResources" : "memory: 0", + "absoluteMaxCapacity" : 15.000001, + "maxActiveApplications" : 1, + "numActiveApplications" : 0, + "absoluteUsedCapacity" : 0, + "userLimit" : 100, + "absoluteCapacity" : 1.0000001, + "maxActiveApplicationsPerUser" : 1, + "capacity" : 10, + "type" : "capacitySchedulerLeafQueueInfo", + "maxApplicationsPerUser" : 0 + } + ] }, - { - "numPendingApplications" : 0, - "queueName" : "a3", - "userLimitFactor" : 1, - "maxApplications" : 400, - "usedCapacity" : 0, - "numContainers" : 0, - "state" : "RUNNING", - "maxCapacity" : 100, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 100, - "maxActiveApplications" : 1, - "numActiveApplications" : 0, - "absoluteUsedCapacity" : 0, - "userLimit" : 100, - "absoluteCapacity" : 4.0000005, - "maxActiveApplicationsPerUser" : 1, - "capacity" : 40, - "type" : "capacitySchedulerLeafQueueInfo", - "maxApplicationsPerUser" : 400 - }, - { - "numPendingApplications" : 0, - "queueName" : "a4", - "userLimitFactor" : 1, - "maxApplications" : 100, - "usedCapacity" : 0, - "numContainers" : 0, - "state" : "RUNNING", - "maxCapacity" : 100, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 100, - "maxActiveApplications" : 1, - "numActiveApplications" : 0, - "absoluteUsedCapacity" : 0, - "userLimit" : 100, - "absoluteCapacity" : 1.0000001, - "maxActiveApplicationsPerUser" : 1, - "capacity" : 10, - "type" : "capacitySchedulerLeafQueueInfo", - "maxApplicationsPerUser" : 100 - } - ], - "state" : "RUNNING", - "maxCapacity" : 15.000001, - "numApplications" : 0, - "usedResources" : "memory: 0", - "absoluteMaxCapacity" : 15.000001 - } - ], + "absoluteUsedCapacity" : 0 + } + ] + }, "usedCapacity" : 0, "capacity" : 100 } @@ -575,7 +597,7 @@ ResourceManager REST API's. } +---+ - <> + <> HTTP Request: @@ -603,155 +625,175 @@ ResourceManager REST API's. 0.0 100.0 root - - 70.0 - 0.0 - 90.0 - 70.0 - 90.0 - 0.0 - 0 - memory: 0 - default - RUNNING - 0 - 0 - 0 - 7000 - 7000 - 1 - 1 - 100 - 1.0 - - 20.0 - 0.0 - 80.0 - 20.0 - 80.0 - 0.0 - 0 - memory: 0 - test - RUNNING - - 60.000004 + + 70.0 0.0 - 80.0 - 12.0 - 16.000002 + 90.0 + 70.0 + 90.0 0.0 0 memory: 0 - a1 + default RUNNING 0 0 0 - 1200 - 1200 + 1 + 1 1 1 100 1.0 - - - 40.0 + + + 20.0 0.0 100.0 - 8.000001 + 20.0 100.0 0.0 0 memory: 0 - a2 + test RUNNING - 0 - 0 - 0 - 800 - 800 - 1 - 1 - 100 - 1.0 - - - - 10.0 - 0.0 - 15.000001 - 10.0 - 15.000001 - 0.0 - 0 - memory: 0 - test2 - RUNNING - - 50.0 - 0.0 - 100.0 - 5.0 - 100.0 - 0.0 - 0 - memory: 0 - A4 - RUNNING - 0 - 0 - 0 - 500 - 500 - 1 - 1 - 100 - 1.0 - - - 40.0 - 0.0 - 100.0 - 4.0000005 - 100.0 - 0.0 - 0 - memory: 0 - a3 - RUNNING - 0 - 0 - 0 - 400 - 400 - 1 - 1 - 100 - 1.0 - - + + + 60.000004 + 0.0 + 100.0 + 12.0 + 100.0 + 0.0 + 0 + memory: 0 + a1 + RUNNING + + + 85.0 + 0.0 + 100.0 + 10.200001 + 100.0 + 0.0 + 0 + memory: 0 + a11 + RUNNING + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 100 + 1.0 + + + 15.000001 + 0.0 + 100.0 + 1.8000001 + 100.0 + 0.0 + 0 + memory: 0 + a12 + RUNNING + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 100 + 1.0 + + + + + 40.0 + 0.0 + 100.0 + 8.000001 + 100.0 + 0.0 + 0 + memory: 0 + a2 + RUNNING + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 100 + 1.0 + + + + 10.0 0.0 - 100.0 - 1.0000001 - 100.0 + 15.000001 + 10.0 + 15.000001 0.0 0 memory: 0 - a4 + test2 RUNNING - 0 - 0 - 0 - 100 - 100 - 1 - 1 - 100 - 1.0 - + + + 90.0 + 0.0 + 100.0 + 9.0 + 15.000001 + 0.0 + 0 + memory: 0 + a3 + RUNNING + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 100 + 1.0 + + + 10.0 + 0.0 + 100.0 + 1.0000001 + 15.000001 + 0.0 + 0 + memory: 0 + a4 + RUNNING + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 100 + 1.0 + + +