hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r1135854 - in /hadoop/common/branches/MR-279/mapreduce: ./ yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ yarn/yarn-server/yarn-server-resourcemanager/src/test/ja...
Date Tue, 14 Jun 2011 23:46:28 GMT
Author: cdouglas
Date: Tue Jun 14 23:46:27 2011
New Revision: 1135854

URL: http://svn.apache.org/viewvc?rev=1135854&view=rev
Log:
MAPREDUCE-2569. Ensure root queue allocated 100% capacity.
Contributed by Jonathan Eagles

Modified:
    hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueParsing.java

Modified: hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/CHANGES.txt?rev=1135854&r1=1135853&r2=1135854&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/CHANGES.txt (original)
+++ hadoop/common/branches/MR-279/mapreduce/CHANGES.txt Tue Jun 14 23:46:27 2011
@@ -5,10 +5,13 @@ Trunk (unreleased changes)
 
     MAPREDUCE-279
 
+    MAPREDUCE-2569. Ensure root queue allocated 100% capacity. (Jonathan
+    Eagles via cdouglas)
+
     Changes to do rack resolutions in the RM and in the AM (ddas)
-   
+
     Fix NPE in history event handling (siddharth seth via mahadev)
-    
+
     Job level node blacklisting. (sharad)
 
     Fixing the bug which was causing FAILED jobs to be displayed as COMPLETED

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java?rev=1135854&r1=1135853&r2=1135854&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java
Tue Jun 14 23:46:27 2011
@@ -108,8 +108,16 @@ public class ParentQueue implements Queu
         QueueMetrics.forQueue(getQueuePath(), parent,
         cs.getConfiguration().getEnableUserMetrics());
 
-    float capacity = 
-      (float)cs.getConfiguration().getCapacity(getQueuePath()) / 100;
+    int rawCapacity = cs.getConfiguration().getCapacity(getQueuePath());
+
+    if (rootQueue &&
+        (rawCapacity != CapacitySchedulerConfiguration.MAXIMUM_CAPACITY_VALUE)) {
+      throw new IllegalArgumentException("Illegal " +
+          "capacity of " + rawCapacity + " for queue " + queueName +
+          ". Must be " + CapacitySchedulerConfiguration.MAXIMUM_CAPACITY_VALUE);
+    }
+
+    float capacity = (float) rawCapacity / 100;
 
     float parentAbsoluteCapacity = 
       (parent == null) ? 1.0f : parent.getAbsoluteCapacity();

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueParsing.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueParsing.java?rev=1135854&r1=1135853&r2=1135854&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueParsing.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueueParsing.java
Tue Jun 14 23:46:27 2011
@@ -93,4 +93,15 @@ public class TestQueueParsing {
     
     LOG.info("Setup 3rd-level queues");
   }
+
+  @Test (expected=java.lang.IllegalArgumentException.class)
+  public void testRootQueueParsing() throws Exception {
+    CapacitySchedulerConfiguration conf = new CapacitySchedulerConfiguration();
+
+    // non-100 percent value will throw IllegalArgumentException
+    conf.setCapacity(CapacityScheduler.ROOT, 90);
+
+    CapacityScheduler capacityScheduler = new CapacityScheduler();
+    capacityScheduler.reinitialize(conf, null, null);
+  }
 }



Mime
View raw message