hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1211247 - in /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ hadoop-yarn/had...
Date Wed, 07 Dec 2011 00:39:23 GMT
Author: mahadev
Date: Wed Dec  7 00:39:22 2011
New Revision: 1211247

URL: http://svn.apache.org/viewvc?rev=1211247&view=rev
Log:
MAPREDUCE-3147. Handle leaf queues with the same name properly. (Ravi Prakash via mahadev)
- Merging r1211243 from trunk.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt?rev=1211247&r1=1211246&r2=1211247&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt Wed Dec  7 00:39:22
2011
@@ -200,6 +200,9 @@ Release 0.23.1 - Unreleased
     MAPREDUCE-3496. Fixed client to print queue acls in consistent order.
     (Jonathan Eagles via acmurthy) 
 
+    MAPREDUCE-3147. Handle leaf queues with the same name properly.
+    (Ravi Prakash via mahadev)
+
 Release 0.23.0 - 2011-11-01 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java?rev=1211247&r1=1211246&r2=1211247&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
Wed Dec  7 00:39:22 2011
@@ -214,7 +214,8 @@ implements ResourceScheduler, CapacitySc
   private static final QueueHook noop = new QueueHook();
   
   @Lock(CapacityScheduler.class)
-  private void initializeQueues(CapacitySchedulerConfiguration conf) {
+  private void initializeQueues(CapacitySchedulerConfiguration conf)
+    throws IOException {
     root = 
         parseQueue(this, conf, null, ROOT, queues, queues, 
             queueComparator, applicationComparator, noop);
@@ -283,7 +284,7 @@ implements ResourceScheduler, CapacitySc
       Map<String, CSQueue> oldQueues, 
       Comparator<CSQueue> queueComparator,
       Comparator<SchedulerApp> applicationComparator,
-      QueueHook hook) {
+      QueueHook hook) throws IOException {
     CSQueue queue;
     String[] childQueueNames = 
       conf.getQueues((parent == null) ? 
@@ -316,6 +317,11 @@ implements ResourceScheduler, CapacitySc
       parentQueue.setChildQueues(childQueues);
     }
 
+    if(queue instanceof LeafQueue == true && queues.containsKey(queueName)
+      && queues.get(queueName) instanceof LeafQueue == true) {
+      throw new IOException("Two leaf queues were named " + queueName
+        + ". Leaf queue names must be distinct");
+    }
     queues.put(queueName, queue);
 
     LOG.info("Initialized queue: " + queue);

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java?rev=1211247&r1=1211246&r2=1211247&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestApplicationLimits.java
Wed Dec  7 00:39:22 2011
@@ -20,6 +20,7 @@ package org.apache.hadoop.yarn.server.re
 import static org.junit.Assert.*;
 import static org.mockito.Mockito.*;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -44,7 +45,7 @@ public class TestApplicationLimits {
   LeafQueue queue;
   
   @Before
-  public void setUp() {
+  public void setUp() throws IOException {
     CapacitySchedulerConfiguration csConf = 
         new CapacitySchedulerConfiguration();
     setupQueueConfiguration(csConf);

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java?rev=1211247&r1=1211246&r2=1211247&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
Wed Dec  7 00:39:22 2011
@@ -240,4 +240,21 @@ public class TestCapacityScheduler {
     node.checkResourceUsage();
   }
 
+  /** Test that parseQueue throws an exception when two leaf queues have the
+   *  same name
+ * @throws IOException
+   */
+  @Test(expected=IOException.class)
+  public void testParseQueue() throws IOException {
+    CapacityScheduler cs = new CapacityScheduler();
+
+    CapacitySchedulerConfiguration conf = new CapacitySchedulerConfiguration();
+    setupQueueConfiguration(conf);
+    conf.setQueues(CapacityScheduler.ROOT + ".a.a1", new String[] {"b1"} );
+    conf.setCapacity(CapacityScheduler.ROOT + ".a.a1.b1", 100);
+    conf.setUserLimitFactor(CapacityScheduler.ROOT + ".a.a1.b1", 100.0f);
+
+    cs.reinitialize(conf, null, null);
+  }
+
 }



Mime
View raw message