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:46:32 +08:00
parent e977876428
commit 3151e95d27
1 changed files with 1 additions and 1 deletions

View File

@ -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;