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
This commit is contained in:
Mahadev Konar 2011-12-01 08:45:43 +00:00
parent 2ef6051da9
commit a7b206219c
3 changed files with 8 additions and 4 deletions

View File

@ -163,6 +163,9 @@ Release 0.23.1 - Unreleased
MAPREDUCE-3463. Second AM fails to recover properly when first AM is killed with MAPREDUCE-3463. Second AM fails to recover properly when first AM is killed with
java.lang.IllegalArgumentException causing lost job. (Siddharth Seth via mahadev) 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 Release 0.23.0 - 2011-11-01
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -145,8 +145,9 @@ public class FifoScheduler implements ResourceScheduler {
boolean includeChildQueues, boolean recursive) { boolean includeChildQueues, boolean recursive) {
QueueInfo queueInfo = recordFactory.newRecordInstance(QueueInfo.class); QueueInfo queueInfo = recordFactory.newRecordInstance(QueueInfo.class);
queueInfo.setQueueName(DEFAULT_QUEUE.getQueueName()); queueInfo.setQueueName(DEFAULT_QUEUE.getQueueName());
queueInfo.setCapacity(100.0f); queueInfo.setCapacity(1.0f);
queueInfo.setMaximumCapacity(100.0f); queueInfo.setCurrentCapacity((float)usedResource.getMemory() / clusterResource.getMemory());
queueInfo.setMaximumCapacity(1.0f);
queueInfo.setChildQueues(new ArrayList<QueueInfo>()); queueInfo.setChildQueues(new ArrayList<QueueInfo>());
queueInfo.setQueueState(QueueState.RUNNING); queueInfo.setQueueState(QueueState.RUNNING);
return queueInfo; return queueInfo;

View File

@ -123,8 +123,8 @@ class DefaultSchedulerPage extends RmView {
span().$style(Q_END)._("100% ")._(). span().$style(Q_END)._("100% ")._().
span(".q", "default")._()._(); span(".q", "default")._()._();
} else { } else {
float used = qInfo.getCurrentCapacity() / 100.0f; float used = qInfo.getCurrentCapacity();
float set = qInfo.getCapacity() / 100.0f; float set = qInfo.getCapacity();
float delta = Math.abs(set - used) + 0.001f; float delta = Math.abs(set - used) + 0.001f;
ul. ul.
li(). li().