diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index da29131aff..e316a6bc21 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -40,9 +40,9 @@ Trunk (unreleased changes) MAPREDUCE-3415. improve MiniMRYarnCluster & DistributedShell JAR resolution. (tucu) - HADOOP-7862 MR changes to work with HADOOP 7862: - Move the support for multiple protocols to lower layer so that Writable, - PB and Avro can all use it (Sanjay) + HADOOP-7862 MR changes to work with HADOOP 7862: + Move the support for multiple protocols to lower layer so that Writable, + PB and Avro can all use it (Sanjay) BUG FIXES MAPREDUCE-3412. Fix 'ant docs'. (amarrk) @@ -249,6 +249,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 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/capacity/CapacityScheduler.java b/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 index 16cdbae771..5f080f8364 100644 --- a/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 +++ b/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 @@ -214,7 +214,8 @@ public CSQueue hook(CSQueue queue) { 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 @@ static CSQueue parseQueue( Map oldQueues, Comparator queueComparator, Comparator applicationComparator, - QueueHook hook) { + QueueHook hook) throws IOException { CSQueue queue; String[] childQueueNames = conf.getQueues((parent == null) ? @@ -316,6 +317,11 @@ static CSQueue parseQueue( 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); diff --git a/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 b/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 index 32d8d97215..3db772c498 100644 --- a/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 +++ b/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 @@ -20,6 +20,7 @@ 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); diff --git a/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 b/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 index 3c110b2130..a43ea51c3f 100644 --- a/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 +++ b/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 @@ -240,4 +240,21 @@ private void checkNodeResourceUsage(int expected, 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); + } + }