瀏覽代碼

YARN-8443. Total #VCores in cluster metrics is wrong when CapacityScheduler reserved some containers. Contributed by Tao Yang.

(Cherry picked by commit 3151e95d27ea0d7e76cc2e1df8f5d88e0f25c713)
Weiwei Yang 7 年之前
父節點
當前提交
a9da764e31

+ 1 - 1
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

@@ -94,7 +94,7 @@ public class ClusterMetricsInfo {
     if (rs instanceof CapacityScheduler) {
     if (rs instanceof CapacityScheduler) {
       this.totalMB = availableMB + allocatedMB + reservedMB;
       this.totalMB = availableMB + allocatedMB + reservedMB;
       this.totalVirtualCores =
       this.totalVirtualCores =
-          availableVirtualCores + allocatedVirtualCores + containersReserved;
+          availableVirtualCores + allocatedVirtualCores + reservedVirtualCores;
     } else {
     } else {
       this.totalMB = availableMB + allocatedMB;
       this.totalMB = availableMB + allocatedMB;
       this.totalVirtualCores = availableVirtualCores + allocatedVirtualCores;
       this.totalVirtualCores = availableVirtualCores + allocatedVirtualCores;