From d81b8163b4e5c0466a6af6e1068f512c5fd24a61 Mon Sep 17 00:00:00 2001 From: Naganarasimha Date: Sat, 6 Aug 2016 01:13:36 +0530 Subject: [PATCH] YARN-4624. NPE in PartitionQueueCapacitiesInfo while accessing Schduler UI. Contributed by Brahma Reddy Battula --- .../webapp/dao/PartitionQueueCapacitiesInfo.java | 4 ++-- .../resourcemanager/webapp/dao/QueueCapacitiesInfo.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/PartitionQueueCapacitiesInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/PartitionQueueCapacitiesInfo.java index 9c73bf26121..5e298f9dc81 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/PartitionQueueCapacitiesInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/PartitionQueueCapacitiesInfo.java @@ -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; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/QueueCapacitiesInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/QueueCapacitiesInfo.java index 1f0aa864ac6..9a3e4392eb4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/QueueCapacitiesInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/QueueCapacitiesInfo.java @@ -49,7 +49,7 @@ public class QueueCapacitiesInfo { 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 class QueueCapacitiesInfo { queueCapacitiesByPartition.add(new PartitionQueueCapacitiesInfo( partitionName, capacity, usedCapacity, maxCapacity, absCapacity, absUsedCapacity, absMaxCapacity, - considerAMUsage ? maxAMLimitPercentage : null)); + considerAMUsage ? maxAMLimitPercentage : 0f)); } }