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/FairSchedulerPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerPage.java index ffa45940d8..ef417d4760 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerPage.java @@ -72,6 +72,8 @@ protected void render(Block html) { ResponseInfo ri = info("\'" + qinfo.getQueueName() + "\' Queue Status"). __("Used Resources:", qinfo.getUsedResources().toString()). __("Demand Resources:", qinfo.getDemandResources().toString()). + __("AM Used Resources:", qinfo.getAMUsedResources().toString()). + __("AM Max Resources:", qinfo.getAMMaxResources().toString()). __("Num Active Applications:", qinfo.getNumActiveApplications()). __("Num Pending Applications:", qinfo.getNumPendingApplications()). __("Min Resources:", qinfo.getMinResources().toString()). 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/FairSchedulerQueueInfo.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/FairSchedulerQueueInfo.java index fa14bae967..a4607c2ee9 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/FairSchedulerQueueInfo.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/FairSchedulerQueueInfo.java @@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlTransient; +import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationConfiguration; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSLeafQueue; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue; @@ -54,6 +55,8 @@ public class FairSchedulerQueueInfo { private ResourceInfo minResources; private ResourceInfo maxResources; private ResourceInfo usedResources; + private ResourceInfo amUsedResources; + private ResourceInfo amMaxResources; private ResourceInfo demandResources; private ResourceInfo steadyFairResources; private ResourceInfo fairResources; @@ -82,6 +85,12 @@ public FairSchedulerQueueInfo(FSQueue queue, FairScheduler scheduler) { clusterResources = new ResourceInfo(scheduler.getClusterResource()); + amUsedResources = new ResourceInfo(Resource.newInstance( + queue.getMetrics().getAMResourceUsageMB(), + queue.getMetrics().getAMResourceUsageVCores())); + amMaxResources = new ResourceInfo(Resource.newInstance( + queue.getMetrics().getMaxAMShareMB(), + queue.getMetrics().getMaxAMShareVCores())); usedResources = new ResourceInfo(queue.getResourceUsage()); demandResources = new ResourceInfo(queue.getDemand()); fractionMemUsed = (float)usedResources.getMemorySize() / @@ -204,6 +213,20 @@ public ResourceInfo getUsedResources() { return usedResources; } + /** + * @return the am used resource of this queue. + */ + public ResourceInfo getAMUsedResources() { + return amUsedResources; + } + + /** + * @return the am max resource of this queue. + */ + public ResourceInfo getAMMaxResources() { + return amMaxResources; + } + /** * @return the demand resource of this queue. */