YARN-1975. Used resources shows escaped html in CapacityScheduler and FairScheduler page. Contributed by Mit Desai

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1589859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2014-04-24 20:02:44 +00:00
parent 730e0675da
commit c02ea74551
3 changed files with 8 additions and 11 deletions

View File

@ -155,6 +155,9 @@ Release 2.4.1 - UNRELEASED
YARN-1932. Javascript injection on the job status page (Mit Desai via YARN-1932. Javascript injection on the job status page (Mit Desai via
jlowe) jlowe)
YARN-1975. Used resources shows escaped html in CapacityScheduler and
FairScheduler page (Mit Desai via jlowe)
Release 2.4.0 - 2014-04-07 Release 2.4.0 - 2014-04-07
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -23,7 +23,6 @@ import static org.apache.hadoop.yarn.util.StringHelper.join;
import java.util.ArrayList; import java.util.ArrayList;
import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.StringUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager; import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
@ -109,7 +108,7 @@ class CapacitySchedulerPage extends RmView {
_("Absolute Used Capacity:", percent(lqinfo.getAbsoluteUsedCapacity() / 100)). _("Absolute Used Capacity:", percent(lqinfo.getAbsoluteUsedCapacity() / 100)).
_("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)). _("Absolute Capacity:", percent(lqinfo.getAbsoluteCapacity() / 100)).
_("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)). _("Absolute Max Capacity:", percent(lqinfo.getAbsoluteMaxCapacity() / 100)).
_("Used Resources:", StringEscapeUtils.escapeHtml(lqinfo.getResourcesUsed().toString())). _("Used Resources:", lqinfo.getResourcesUsed().toString()).
_("Num Schedulable Applications:", Integer.toString(lqinfo.getNumActiveApplications())). _("Num Schedulable Applications:", Integer.toString(lqinfo.getNumActiveApplications())).
_("Num Non-Schedulable Applications:", Integer.toString(lqinfo.getNumPendingApplications())). _("Num Non-Schedulable Applications:", Integer.toString(lqinfo.getNumPendingApplications())).
_("Num Containers:", Integer.toString(lqinfo.getNumContainers())). _("Num Containers:", Integer.toString(lqinfo.getNumContainers())).

View File

@ -22,7 +22,6 @@ import static org.apache.hadoop.yarn.util.StringHelper.join;
import java.util.Collection; 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.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FairSchedulerInfo; import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FairSchedulerInfo;
@ -65,20 +64,16 @@ public class FairSchedulerPage extends RmView {
@Override @Override
protected void render(Block html) { protected void render(Block html) {
ResponseInfo ri = info("\'" + qinfo.getQueueName() + "\' Queue Status"). ResponseInfo ri = info("\'" + qinfo.getQueueName() + "\' Queue Status").
_("Used Resources:", StringEscapeUtils.escapeHtml( _("Used Resources:", qinfo.getUsedResources().toString()).
qinfo.getUsedResources().toString())).
_("Num Active Applications:", qinfo.getNumActiveApplications()). _("Num Active Applications:", qinfo.getNumActiveApplications()).
_("Num Pending Applications:", qinfo.getNumPendingApplications()). _("Num Pending Applications:", qinfo.getNumPendingApplications()).
_("Min Resources:", StringEscapeUtils.escapeHtml( _("Min Resources:", qinfo.getMinResources().toString()).
qinfo.getMinResources().toString())). _("Max Resources:", qinfo.getMaxResources().toString());
_("Max Resources:", StringEscapeUtils.escapeHtml(
qinfo.getMaxResources().toString()));
int maxApps = qinfo.getMaxApplications(); int maxApps = qinfo.getMaxApplications();
if (maxApps < Integer.MAX_VALUE) { if (maxApps < Integer.MAX_VALUE) {
ri._("Max Running Applications:", qinfo.getMaxApplications()); ri._("Max Running Applications:", qinfo.getMaxApplications());
} }
ri._("Fair Share:", StringEscapeUtils.escapeHtml( ri._("Fair Share:", qinfo.getFairShare().toString());
qinfo.getFairShare().toString()));
html._(InfoBlock.class); html._(InfoBlock.class);