YARN-1044. used/min/max resources do not display info in the scheduler page (Sangjin Lee via Sandy Ryza)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1531449 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sanford Ryza 2013-10-11 22:17:24 +00:00
parent c89a36106e
commit ae42ecbc01
5 changed files with 14 additions and 18 deletions

View File

@ -90,6 +90,10 @@ Release 2.2.1 - UNRELEASED
YARN-1284. LCE: Race condition leaves dangling cgroups entries for killed
containers. (Alejandro Abdelnur via Sandy Ryza)
YARN-1044. used/min/max resources do not display info in the scheduler page
(Sangjin Lee via Sandy Ryza)
>>>>>>> .merge-right.r1531447
Release 2.2.0 - 2013-10-13
INCOMPATIBLE CHANGES

View File

@ -109,7 +109,7 @@ protected void render(Block html) {
_("Absolute Used Capacity:", percent(lqinfo.getAbsoluteUsedCapacity() / 100)).
_("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)).
_("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)).
_("Used Resources:", StringEscapeUtils.escapeHtml(lqinfo.getUsedResources().toString())).
_("Used Resources:", StringEscapeUtils.escapeHtml(lqinfo.getResourcesUsed().toString())).
_("Num Schedulable Applications:", Integer.toString(lqinfo.getNumActiveApplications())).
_("Num Non-Schedulable Applications:", Integer.toString(lqinfo.getNumPendingApplications())).
_("Num Containers:", Integer.toString(lqinfo.getNumContainers())).

View File

@ -22,6 +22,7 @@
import java.util.Collection;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FairSchedulerInfo;
@ -64,11 +65,14 @@ static class LeafQueueBlock extends HtmlBlock {
@Override
protected void render(Block html) {
ResponseInfo ri = info("\'" + qinfo.getQueueName() + "\' Queue Status").
_("Used Resources:", qinfo.getUsedResources().toString()).
_("Used Resources:", StringEscapeUtils.escapeHtml(
qinfo.getUsedResources().toString())).
_("Num Active Applications:", qinfo.getNumActiveApplications()).
_("Num Pending Applications:", qinfo.getNumPendingApplications()).
_("Min Resources:", qinfo.getMinResources().toString()).
_("Max Resources:", qinfo.getMaxResources().toString());
_("Min Resources:", StringEscapeUtils.escapeHtml(
qinfo.getMinResources().toString())).
_("Max Resources:", StringEscapeUtils.escapeHtml(
qinfo.getMaxResources().toString()));
int maxApps = qinfo.getMaxApplications();
if (maxApps < Integer.MAX_VALUE) {
ri._("Max Running Applications:", qinfo.getMaxApplications());

View File

@ -44,7 +44,6 @@ public class CapacitySchedulerQueueInfo {
protected float absoluteMaxCapacity;
protected float absoluteUsedCapacity;
protected int numApplications;
protected String usedResources;
protected String queueName;
protected QueueState state;
protected CapacitySchedulerQueueInfoList queues;
@ -67,7 +66,6 @@ public class CapacitySchedulerQueueInfo {
absoluteMaxCapacity = cap(q.getAbsoluteMaximumCapacity(), 0f, 1f) * 100;
absoluteUsedCapacity = cap(q.getAbsoluteUsedCapacity(), 0f, 1f) * 100;
numApplications = q.getNumApplications();
usedResources = q.getUsedResources().toString();
queueName = q.getQueueName();
state = q.getState();
resourcesUsed = new ResourceInfo(q.getUsedResources());
@ -101,10 +99,6 @@ public int getNumApplications() {
return numApplications;
}
public String getUsedResources() {
return usedResources;
}
public String getQueueName() {
return this.queueName;
}

View File

@ -75,7 +75,6 @@ private class QueueInfo {
float absoluteMaxCapacity;
float absoluteUsedCapacity;
int numApplications;
String usedResources;
String queueName;
String state;
}
@ -283,8 +282,6 @@ public void verifySubQueueXML(Element qElem, String q,
WebServicesTestUtils.getXmlFloat(qElem, "absoluteUsedCapacity");
qi.numApplications =
WebServicesTestUtils.getXmlInt(qElem, "numApplications");
qi.usedResources =
WebServicesTestUtils.getXmlString(qElem, "usedResources");
qi.queueName = WebServicesTestUtils.getXmlString(qElem, "queueName");
qi.state = WebServicesTestUtils.getXmlString(qElem, "state");
verifySubQueueGeneric(q, qi, parentAbsCapacity, parentAbsMaxCapacity);
@ -360,10 +357,10 @@ private void verifyClusterSchedulerGeneric(String type, float usedCapacity,
private void verifySubQueue(JSONObject info, String q,
float parentAbsCapacity, float parentAbsMaxCapacity)
throws JSONException, Exception {
int numExpectedElements = 12;
int numExpectedElements = 11;
boolean isParentQueue = true;
if (!info.has("queues")) {
numExpectedElements = 22;
numExpectedElements = 21;
isParentQueue = false;
}
assertEquals("incorrect number of elements", numExpectedElements, info.length());
@ -376,7 +373,6 @@ private void verifySubQueue(JSONObject info, String q,
qi.absoluteMaxCapacity = (float) info.getDouble("absoluteMaxCapacity");
qi.absoluteUsedCapacity = (float) info.getDouble("absoluteUsedCapacity");
qi.numApplications = info.getInt("numApplications");
qi.usedResources = info.getString("usedResources");
qi.queueName = info.getString("queueName");
qi.state = info.getString("state");
@ -431,8 +427,6 @@ private void verifySubQueueGeneric(String q, QueueInfo info,
assertEquals("absoluteUsedCapacity doesn't match",
0, info.absoluteUsedCapacity, 1e-3f);
assertEquals("numApplications doesn't match", 0, info.numApplications);
assertTrue("usedResources doesn't match ",
info.usedResources.matches("<memory:0, vCores:0>"));
assertTrue("queueName doesn't match, got: " + info.queueName
+ " expected: " + q, qshortName.matches(info.queueName));
assertTrue("state doesn't match",