hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r1409832 - in /hadoop/common/branches/branch-0.23/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/
Date Thu, 15 Nov 2012 15:25:49 GMT
Author: bobby
Date: Thu Nov 15 15:25:48 2012
New Revision: 1409832

URL: http://svn.apache.org/viewvc?rev=1409832&view=rev
Log:
svn merge -c 1409827 FIXES: YARN-188. Coverage fixing for CapacityScheduler (Aleksey Gorshkov
via bobby)

Modified:
    hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt
    hadoop/common/branches/branch-0.23/hadoop-yarn-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-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt?rev=1409832&r1=1409831&r2=1409832&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-yarn-project/CHANGES.txt Thu Nov 15 15:25:48
2012
@@ -12,6 +12,9 @@ Release 0.23.6 - UNRELEASED
 
   BUG FIXES
 
+    YARN-188. Coverage fixing for CapacityScheduler (Aleksey Gorshkov via
+    bobby)
+
 Release 0.23.5 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.23/hadoop-yarn-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-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java?rev=1409832&r1=1409831&r2=1409832&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-yarn-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-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacityScheduler.java
Thu Nov 15 15:25:48 2012
@@ -30,6 +30,8 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.net.NetworkTopology;
 import org.apache.hadoop.yarn.api.records.Priority;
+import org.apache.hadoop.yarn.api.records.QueueInfo;
+import org.apache.hadoop.yarn.api.records.QueueUserACLInfo;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.event.AsyncDispatcher;
@@ -411,5 +413,28 @@ public class TestCapacityScheduler {
       B3_CAPACITY += B4_CAPACITY;
     }
   }
+  @Test
+  public void testCapacitySchedulerInfo() throws Exception {
+    QueueInfo queueInfo = resourceManager.getResourceScheduler().getQueueInfo("a", true,
true);
+    Assert.assertEquals(queueInfo.getQueueName(), "a");
+    Assert.assertEquals(queueInfo.getChildQueues().size(), 2);
+
+    List<QueueUserACLInfo> userACLInfo = resourceManager.getResourceScheduler().getQueueUserAclInfo();
+    Assert.assertNotNull(userACLInfo);
+    for (QueueUserACLInfo queueUserACLInfo : userACLInfo) {
+      Assert.assertEquals(getQueueCount(userACLInfo, queueUserACLInfo.getQueueName()), 1);
+    }
+
+  }
+
+  private int getQueueCount(List<QueueUserACLInfo> queueInformation, String queueName)
{
+    int result = 0;
+    for (QueueUserACLInfo queueUserACLInfo : queueInformation) {
+      if (queueName.equals(queueUserACLInfo.getQueueName())) {
+        result++;
+      }
+    }
+    return result;
+  }
 
 }



Mime
View raw message