myhonor2013 commented on a change in pull request #2238:
URL: https://github.com/apache/hadoop/pull/2238#discussion_r475297726



##########
File path: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/ClusterMetricsInfo.java
##########
@@ -134,6 +135,11 @@ public ClusterMetricsInfo(final ResourceScheduler rs) {
       this.totalMB = availableMB + allocatedMB;
       this.totalVirtualCores = availableVirtualCores + allocatedVirtualCores;
     }
+    if (rs instanceof FairScheduler) {
+      FairScheduler fs = (FairScheduler) rs;
+      totalUsedResourcesAcrossPartition = new 
ResourceInfo(fs.getQueueManager().getRootQueue().getResourceUsage());
+      totalClusterResourcesAcrossPartition = new 
ResourceInfo(fs.getClusterResource());
+    }

Review comment:
       It seems we also need to add the snippet below to the FairScheduler 
conditional branch if we move the code segment to else if clause
   `
   this.totalMB = availableMB + allocatedMB;
   this.totalVirtualCores = availableVirtualCores + allocatedVirtualCores;
   `




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to