YARN-4624. NPE in PartitionQueueCapacitiesInfo while accessing Schduler UI. Contributed by Brahma Reddy Battula

This commit is contained in:
Naganarasimha 2016-08-06 01:13:36 +05:30
parent e605d47df0
commit d81b8163b4
2 changed files with 4 additions and 4 deletions

View File

@ -35,14 +35,14 @@ public class PartitionQueueCapacitiesInfo {
private float absoluteCapacity;
private float absoluteUsedCapacity;
private float absoluteMaxCapacity = 100;
private Float maxAMLimitPercentage;
private float maxAMLimitPercentage;
public PartitionQueueCapacitiesInfo() {
}
public PartitionQueueCapacitiesInfo(String partitionName, float capacity,
float usedCapacity, float maxCapacity, float absCapacity,
float absUsedCapacity, float absMaxCapacity, Float maxAMLimitPercentage) {
float absUsedCapacity, float absMaxCapacity, float maxAMLimitPercentage) {
super();
this.partitionName = partitionName;
this.capacity = capacity;

View File

@ -49,7 +49,7 @@ public QueueCapacitiesInfo(QueueCapacities capacities,
float absCapacity;
float absUsedCapacity;
float absMaxCapacity;
Float maxAMLimitPercentage;
float maxAMLimitPercentage;
for (String partitionName : capacities.getExistingNodeLabels()) {
usedCapacity = capacities.getUsedCapacity(partitionName) * 100;
capacity = capacities.getCapacity(partitionName) * 100;
@ -68,7 +68,7 @@ public QueueCapacitiesInfo(QueueCapacities capacities,
queueCapacitiesByPartition.add(new PartitionQueueCapacitiesInfo(
partitionName, capacity, usedCapacity, maxCapacity, absCapacity,
absUsedCapacity, absMaxCapacity,
considerAMUsage ? maxAMLimitPercentage : null));
considerAMUsage ? maxAMLimitPercentage : 0f));
}
}