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/CapacitySchedulerPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java index ed2f64e0945..8f68e83afdb 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/CapacitySchedulerPage.java @@ -157,10 +157,12 @@ class CapacitySchedulerPage extends RmView { : resourceUsages.getAmUsed(); ri. __("Used Capacity:", - appendPercent(resourceUsages.getUsed().toString(), + appendPercent(resourceUsages.getUsed(), capacities.getUsedCapacity() / 100)) .__("Configured Capacity:", - capacities.getConfiguredMinResource().toString()) + capacities.getConfiguredMinResource() == null ? + Resources.none().toString() : + capacities.getConfiguredMinResource().toString()) .__("Configured Max Capacity:", (capacities.getConfiguredMaxResource() == null || capacities.getConfiguredMaxResource().getResource() @@ -168,10 +170,10 @@ class CapacitySchedulerPage extends RmView { ? "unlimited" : capacities.getConfiguredMaxResource().toString()) .__("Effective Capacity:", - appendPercent(capacities.getEffectiveMinResource().toString(), + appendPercent(capacities.getEffectiveMinResource(), capacities.getCapacity() / 100)) .__("Effective Max Capacity:", - appendPercent(capacities.getEffectiveMaxResource().toString(), + appendPercent(capacities.getEffectiveMaxResource(), capacities.getMaxCapacity() / 100)) .__("Absolute Used Capacity:", percent(capacities.getAbsoluteUsedCapacity() / 100)) @@ -320,6 +322,8 @@ class CapacitySchedulerPage extends RmView { boolean isAutoCreatedLeafQueue = info.isLeafQueue() ? ((CapacitySchedulerLeafQueueInfo) info).isAutoCreatedLeafQueue() : false; + float capPercent = absMaxCap == 0 ? 0 : absCap/absMaxCap; + float usedCapPercent = absMaxCap == 0 ? 0 : absUsedCap/absMaxCap; String Q_WIDTH = width(absMaxCap * Q_MAX_WIDTH); LI