Author: bobby Date: Tue Jul 31 19:37:54 2012 New Revision: 1367723 URL: http://svn.apache.org/viewvc?rev=1367723&view=rev Log: svn merge -c 1367719 FIXES: MAPREDUCE-4492. Configuring total queue capacity between 100.5 and 99.5 at perticular level is sucessfull (Mayank Bansal via bobby)
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/ParentQueue.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/TestParentQueue.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=1367723&r1=1367722&r2=1367723&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 Tue Jul 31 19:37:54 2012 @@ -366,6 +366,9 @@ Release 0.23.3 - UNRELEASED MAPREDUCE-4493. Distibuted Cache Compatability Issues (Robert Evans via tgraves) + MAPREDUCE-4492. Configuring total queue capacity between 100.5 and 99.5 at + perticular level is sucessfull (Mayank Bansal via bobby) + Release 0.23.2 - UNRELEASED 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/ParentQueue.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/ParentQueue.java?rev=1367723&r1=1367722&r2=1367723&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/ParentQueue.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/ParentQueue.java Tue Jul 31 19:37:54 2012 @@ -192,7 +192,7 @@ public class ParentQueue implements CSQu ", acls=" + aclsString); } - private static float PRECISION = 0.005f; // 0.05% precision + private static float PRECISION = 0.0005f; // 0.05% precision void setChildQueues(Collection<CSQueue> childQueues) { // Validate 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/TestParentQueue.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/TestParentQueue.java?rev=1367723&r1=1367722&r2=1367723&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/TestParentQueue.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/TestParentQueue.java Tue Jul 31 19:37:54 2012 @@ -34,6 +34,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import junit.framework.Assert; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.security.UserGroupInformation; @@ -266,6 +268,61 @@ public class TestParentQueue { verifyQueueMetrics(b, 9*GB, clusterResource); } + @Test + public void testSingleLevelQueuesPrecision() throws Exception { + // Setup queue configs + setupSingleLevelQueues(csConf); + final String Q_A = CapacitySchedulerConfiguration.ROOT + "." + "a"; + csConf.setCapacity(Q_A, 30); + final String Q_B = CapacitySchedulerConfiguration.ROOT + "." + "b"; + csConf.setCapacity(Q_B, 70.5F); + + Map<String, CSQueue> queues = new HashMap<String, CSQueue>(); + boolean exceptionOccured = false; + try { + CapacityScheduler.parseQueue(csContext, csConf, null, + CapacitySchedulerConfiguration.ROOT, queues, queues, + CapacityScheduler.queueComparator, + CapacityScheduler.applicationComparator, TestUtils.spyHook); + } catch (IllegalArgumentException ie) { + exceptionOccured = true; + } + if (!exceptionOccured) { + Assert.fail("Capacity is more then 100% so should be failed."); + } + csConf.setCapacity(Q_A, 30); + csConf.setCapacity(Q_B, 70); + exceptionOccured = false; + queues.clear(); + try { + CapacityScheduler.parseQueue(csContext, csConf, null, + CapacitySchedulerConfiguration.ROOT, queues, queues, + CapacityScheduler.queueComparator, + CapacityScheduler.applicationComparator, TestUtils.spyHook); + } catch (IllegalArgumentException ie) { + exceptionOccured = true; + } + if (exceptionOccured) { + Assert.fail("Capacity is 100% so should not be failed."); + } + csConf.setCapacity(Q_A, 30); + csConf.setCapacity(Q_B, 70.005F); + exceptionOccured = false; + queues.clear(); + try { + CapacityScheduler.parseQueue(csContext, csConf, null, + CapacitySchedulerConfiguration.ROOT, queues, queues, + CapacityScheduler.queueComparator, + CapacityScheduler.applicationComparator, TestUtils.spyHook); + } catch (IllegalArgumentException ie) { + exceptionOccured = true; + } + if (exceptionOccured) { + Assert + .fail("Capacity is under PRECISION which is .05% so should not be failed."); + } + } + private static final String C = "c"; private static final String C1 = "c1"; private static final String C11 = "c11";