YARN-4995. FairScheduler: Display per-queue demand on the scheduler page. (xupeng via kasha)

This commit is contained in:
Karthik Kambatla 2016-05-11 17:36:21 -07:00
parent 687233f20d
commit 4b4e4c6ba8
2 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,7 @@ static class LeafQueueBlock extends HtmlBlock {
protected void render(Block html) {
ResponseInfo ri = info("\'" + qinfo.getQueueName() + "\' Queue Status").
_("Used Resources:", qinfo.getUsedResources().toString()).
_("Demand Resources:", qinfo.getDemandResources().toString()).
_("Num Active Applications:", qinfo.getNumActiveApplications()).
_("Num Pending Applications:", qinfo.getNumPendingApplications()).
_("Min Resources:", qinfo.getMinResources().toString()).

View File

@ -54,6 +54,7 @@ public class FairSchedulerQueueInfo {
private ResourceInfo minResources;
private ResourceInfo maxResources;
private ResourceInfo usedResources;
private ResourceInfo demandResources;
private ResourceInfo steadyFairResources;
private ResourceInfo fairResources;
private ResourceInfo clusterResources;
@ -81,6 +82,7 @@ public FairSchedulerQueueInfo(FSQueue queue, FairScheduler scheduler) {
clusterResources = new ResourceInfo(scheduler.getClusterResource());
usedResources = new ResourceInfo(queue.getResourceUsage());
demandResources = new ResourceInfo(queue.getDemand());
fractionMemUsed = (float)usedResources.getMemory() /
clusterResources.getMemory();
@ -196,6 +198,13 @@ public ResourceInfo getUsedResources() {
return usedResources;
}
/**
* @return the demand resource of this queue.
*/
public ResourceInfo getDemandResources() {
return demandResources;
}
/**
* Returns the queue's min share in as a fraction of the entire
* cluster capacity.