From a7b206219c9d9296a79d664ced88d8dbcd19c287 Mon Sep 17 00:00:00 2001 From: Mahadev Konar Date: Thu, 1 Dec 2011 08:45:43 +0000 Subject: [PATCH] MAPREDUCE-3452. fifoscheduler web ui page always shows 0% used for the queue. (Jonathan Eagles via mahadev) - Merging r1208999 from trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1209002 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../server/resourcemanager/scheduler/fifo/FifoScheduler.java | 5 +++-- .../server/resourcemanager/webapp/DefaultSchedulerPage.java | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index f1fb6f5d2ac..690d2449677 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -163,6 +163,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3463. Second AM fails to recover properly when first AM is killed with java.lang.IllegalArgumentException causing lost job. (Siddharth Seth via mahadev) + MAPREDUCE-3452. fifoscheduler web ui page always shows 0% used for the queue. + (Jonathan Eagles via mahadev) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java index 977150520a1..c90566bd5b5 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java @@ -145,8 +145,9 @@ public class FifoScheduler implements ResourceScheduler { boolean includeChildQueues, boolean recursive) { QueueInfo queueInfo = recordFactory.newRecordInstance(QueueInfo.class); queueInfo.setQueueName(DEFAULT_QUEUE.getQueueName()); - queueInfo.setCapacity(100.0f); - queueInfo.setMaximumCapacity(100.0f); + queueInfo.setCapacity(1.0f); + queueInfo.setCurrentCapacity((float)usedResource.getMemory() / clusterResource.getMemory()); + queueInfo.setMaximumCapacity(1.0f); queueInfo.setChildQueues(new ArrayList()); queueInfo.setQueueState(QueueState.RUNNING); return queueInfo; diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/DefaultSchedulerPage.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/DefaultSchedulerPage.java index 8db4caffd89..8882eea884b 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/DefaultSchedulerPage.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/DefaultSchedulerPage.java @@ -123,8 +123,8 @@ class DefaultSchedulerPage extends RmView { span().$style(Q_END)._("100% ")._(). span(".q", "default")._()._(); } else { - float used = qInfo.getCurrentCapacity() / 100.0f; - float set = qInfo.getCapacity() / 100.0f; + float used = qInfo.getCurrentCapacity(); + float set = qInfo.getCapacity(); float delta = Math.abs(set - used) + 0.001f; ul. li().