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

This commit is contained in:
Weiwei Yang 2018-06-25 09:15:31 +08:00
parent e16e5b307d
commit 440140cea6

View File

@ -101,7 +101,7 @@ public ClusterMetricsInfo(final ResourceScheduler rs) {
CapacityScheduler cs = (CapacityScheduler) rs;
this.totalMB = availableMB + allocatedMB + reservedMB;
this.totalVirtualCores =
availableVirtualCores + allocatedVirtualCores + containersReserved;
availableVirtualCores + allocatedVirtualCores + reservedVirtualCores;
// TODO, add support of other schedulers to get total used resources
// across partition.
if (cs.getRootQueue() != null