hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1362332 [3/3] - in /hadoop/common/trunk/hadoop-mapreduce-project: ./ hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/ hadoop-yarn/hadoop-yarn-server/hadoop...
Date Tue, 17 Jul 2012 01:43:04 GMT
Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestLeafQueue.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestLeafQueue.java?rev=1362332&r1=1362331&r2=1362332&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestLeafQueue.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestLeafQueue.java
Tue Jul 17 01:43:03 2012
@@ -62,8 +62,8 @@ import org.apache.hadoop.yarn.server.res
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ActiveUsersManager;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.NodeType;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApp;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerNode;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.AppRemovedSchedulerEvent;
 import org.junit.After;
 import org.junit.Before;
@@ -171,14 +171,14 @@ public class TestLeafQueue {
           @Override
           public Container answer(InvocationOnMock invocation) 
               throws Throwable {
-            final SchedulerApp application = 
-                (SchedulerApp)(invocation.getArguments()[0]);
+            final FiCaSchedulerApp application = 
+                (FiCaSchedulerApp)(invocation.getArguments()[0]);
             final ContainerId containerId =                 
                 TestUtils.getMockContainerId(application);
 
             Container container = TestUtils.getMockContainer(
                 containerId,
-                ((SchedulerNode)(invocation.getArguments()[1])).getNodeID(), 
+                ((FiCaSchedulerNode)(invocation.getArguments()[1])).getNodeID(), 
                 (Resource)(invocation.getArguments()[2]),
                 ((Priority)invocation.getArguments()[3]));
             return container;
@@ -186,8 +186,8 @@ public class TestLeafQueue {
         }
       ).
       when(queue).createContainer(
-              any(SchedulerApp.class), 
-              any(SchedulerNode.class), 
+              any(FiCaSchedulerApp.class), 
+              any(FiCaSchedulerNode.class), 
               any(Resource.class),
               any(Priority.class)
               );
@@ -195,7 +195,7 @@ public class TestLeafQueue {
     // 2. Stub out LeafQueue.parent.completedContainer
     CSQueue parent = queue.getParent();
     doNothing().when(parent).completedContainer(
-        any(Resource.class), any(SchedulerApp.class), any(SchedulerNode.class), 
+        any(Resource.class), any(FiCaSchedulerApp.class), any(FiCaSchedulerNode.class), 
         any(RMContainer.class), any(ContainerStatus.class), 
         any(RMContainerEventType.class));
     
@@ -238,22 +238,22 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_0, user_0, B);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_0, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_1, user_0, B);  // same user
 
     
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
     
     final int numNodes = 1;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -284,14 +284,14 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = TestUtils
         .getMockApplicationAttemptId(0, 1);
-    SchedulerApp app_0 = new SchedulerApp(appAttemptId_0, user_d, d, null,
+    FiCaSchedulerApp app_0 = new FiCaSchedulerApp(appAttemptId_0, user_d, d, null,
         rmContext, null);
     d.submitApplication(app_0, user_d, D);
 
     // Attempt the same application again
     final ApplicationAttemptId appAttemptId_1 = TestUtils
         .getMockApplicationAttemptId(0, 2);
-    SchedulerApp app_1 = new SchedulerApp(appAttemptId_1, user_d, d, null,
+    FiCaSchedulerApp app_1 = new FiCaSchedulerApp(appAttemptId_1, user_d, d, null,
         rmContext, null);
     d.submitApplication(app_1, user_d, D); // same user
   }
@@ -309,7 +309,7 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = TestUtils
         .getMockApplicationAttemptId(0, 1);
-    SchedulerApp app_0 = new SchedulerApp(appAttemptId_0, user_0, a, null,
+    FiCaSchedulerApp app_0 = new FiCaSchedulerApp(appAttemptId_0, user_0, a, null,
         rmContext, null);
     a.submitApplication(app_0, user_0, B);
     
@@ -324,7 +324,7 @@ public class TestLeafQueue {
     // Attempt the same application again
     final ApplicationAttemptId appAttemptId_1 = TestUtils
         .getMockApplicationAttemptId(0, 2);
-    SchedulerApp app_1 = new SchedulerApp(appAttemptId_1, user_0, a, null,
+    FiCaSchedulerApp app_1 = new FiCaSchedulerApp(appAttemptId_1, user_0, a, null,
         rmContext, null);
     a.submitApplication(app_1, user_0, B); // same user
 
@@ -359,22 +359,22 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_0, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_1, user_0, A);  // same user
 
     
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
     
     final int numNodes = 1;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -483,30 +483,30 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_0, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_0, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_1, user_0, A);  // same user
 
     final ApplicationAttemptId appAttemptId_2 = 
         TestUtils.getMockApplicationAttemptId(2, 0); 
-    SchedulerApp app_2 = 
-        new SchedulerApp(appAttemptId_2, user_1, a, 
+    FiCaSchedulerApp app_2 = 
+        new FiCaSchedulerApp(appAttemptId_2, user_1, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_2, user_1, A);
 
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
     String host_1 = "host_1";
-    SchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 8*GB);
     
     final int numNodes = 2;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -576,30 +576,30 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_0, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_0, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_1, user_0, A);  // same user
 
     final ApplicationAttemptId appAttemptId_2 = 
         TestUtils.getMockApplicationAttemptId(2, 0); 
-    SchedulerApp app_2 = 
-        new SchedulerApp(appAttemptId_2, user_1, a, 
+    FiCaSchedulerApp app_2 = 
+        new FiCaSchedulerApp(appAttemptId_2, user_1, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_2, user_1, A);
 
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
     String host_1 = "host_1";
-    SchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 8*GB);
     
     final int numNodes = 2;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -687,35 +687,35 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_0, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_0, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_1, user_0, A);  // same user
 
     final ApplicationAttemptId appAttemptId_2 = 
         TestUtils.getMockApplicationAttemptId(2, 0); 
-    SchedulerApp app_2 = 
-        new SchedulerApp(appAttemptId_2, user_1, a, 
+    FiCaSchedulerApp app_2 = 
+        new FiCaSchedulerApp(appAttemptId_2, user_1, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_2, user_1, A);
 
     final ApplicationAttemptId appAttemptId_3 = 
         TestUtils.getMockApplicationAttemptId(3, 0); 
-    SchedulerApp app_3 = 
-        new SchedulerApp(appAttemptId_3, user_2, a, 
+    FiCaSchedulerApp app_3 = 
+        new FiCaSchedulerApp(appAttemptId_3, user_2, a, 
             a.getActiveUsersManager(), rmContext, null);
     a.submitApplication(app_3, user_2, A);
     
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
     
     final int numNodes = 1;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -862,21 +862,21 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_1, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_1, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_1, user_1, A);  
 
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 4*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 4*GB);
     
     final int numNodes = 2;
     Resource clusterResource = Resources.createResource(numNodes * (4*GB));
@@ -961,23 +961,23 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 =
         TestUtils.getMockApplicationAttemptId(0, 0);
-    SchedulerApp app_0 =
-        new SchedulerApp(appAttemptId_0, user_0, a,
+    FiCaSchedulerApp app_0 =
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a,
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 =
         TestUtils.getMockApplicationAttemptId(1, 0);
-    SchedulerApp app_1 =
-        new SchedulerApp(appAttemptId_1, user_1, a,
+    FiCaSchedulerApp app_1 =
+        new FiCaSchedulerApp(appAttemptId_1, user_1, a,
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_1, user_1, A);
 
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 4*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 4*GB);
     String host_1 = "host_1";
-    SchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 4*GB);
+    FiCaSchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 4*GB);
 
     final int numNodes = 3;
     Resource clusterResource = Resources.createResource(numNodes * (4*GB));
@@ -1060,24 +1060,24 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_0, user_0, A);
 
     final ApplicationAttemptId appAttemptId_1 = 
         TestUtils.getMockApplicationAttemptId(1, 0); 
-    SchedulerApp app_1 = 
-        new SchedulerApp(appAttemptId_1, user_1, a, 
+    FiCaSchedulerApp app_1 = 
+        new FiCaSchedulerApp(appAttemptId_1, user_1, a, 
             mock(ActiveUsersManager.class), rmContext, null);
     a.submitApplication(app_1, user_1, A);  
 
     // Setup some nodes
     String host_0 = "host_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 4*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 4*GB);
     
     String host_1 = "host_1";
-    SchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 4*GB);
+    FiCaSchedulerNode node_1 = TestUtils.getMockNode(host_1, DEFAULT_RACK, 0, 4*GB);
     
     final int numNodes = 3;
     Resource clusterResource = Resources.createResource(numNodes * (4*GB));
@@ -1175,23 +1175,23 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        spy(new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        spy(new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null));
     a.submitApplication(app_0, user_0, A);
     
     // Setup some nodes and racks
     String host_0 = "host_0";
     String rack_0 = "rack_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, rack_0, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, rack_0, 0, 8*GB);
     
     String host_1 = "host_1";
     String rack_1 = "rack_1";
-    SchedulerNode node_1 = TestUtils.getMockNode(host_1, rack_1, 0, 8*GB);
+    FiCaSchedulerNode node_1 = TestUtils.getMockNode(host_1, rack_1, 0, 8*GB);
     
     String host_2 = "host_2";
     String rack_2 = "rack_2";
-    SchedulerNode node_2 = TestUtils.getMockNode(host_2, rack_2, 0, 8*GB);
+    FiCaSchedulerNode node_2 = TestUtils.getMockNode(host_2, rack_2, 0, 8*GB);
 
     final int numNodes = 3;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -1284,7 +1284,7 @@ public class TestLeafQueue {
     assertEquals(1, app_0.getTotalRequiredResources(priority));
     
     String host_3 = "host_3"; // on rack_1
-    SchedulerNode node_3 = TestUtils.getMockNode(host_3, rack_1, 0, 8*GB);
+    FiCaSchedulerNode node_3 = TestUtils.getMockNode(host_3, rack_1, 0, 8*GB);
     
     assignment = a.assignContainers(clusterResource, node_3);
     verify(app_0).allocate(eq(NodeType.RACK_LOCAL), eq(node_3), 
@@ -1305,23 +1305,23 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        spy(new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        spy(new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null));
     a.submitApplication(app_0, user_0, A);
     
     // Setup some nodes and racks
     String host_0 = "host_0";
     String rack_0 = "rack_0";
-    SchedulerNode node_0 = TestUtils.getMockNode(host_0, rack_0, 0, 8*GB);
+    FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, rack_0, 0, 8*GB);
     
     String host_1 = "host_1";
     String rack_1 = "rack_1";
-    SchedulerNode node_1 = TestUtils.getMockNode(host_1, rack_1, 0, 8*GB);
+    FiCaSchedulerNode node_1 = TestUtils.getMockNode(host_1, rack_1, 0, 8*GB);
     
     String host_2 = "host_2";
     String rack_2 = "rack_2";
-    SchedulerNode node_2 = TestUtils.getMockNode(host_2, rack_2, 0, 8*GB);
+    FiCaSchedulerNode node_2 = TestUtils.getMockNode(host_2, rack_2, 0, 8*GB);
 
     final int numNodes = 3;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));
@@ -1435,22 +1435,22 @@ public class TestLeafQueue {
     // Submit applications
     final ApplicationAttemptId appAttemptId_0 = 
         TestUtils.getMockApplicationAttemptId(0, 0); 
-    SchedulerApp app_0 = 
-        spy(new SchedulerApp(appAttemptId_0, user_0, a, 
+    FiCaSchedulerApp app_0 = 
+        spy(new FiCaSchedulerApp(appAttemptId_0, user_0, a, 
             mock(ActiveUsersManager.class), rmContext, null));
     a.submitApplication(app_0, user_0, A);
     
     // Setup some nodes and racks
     String host_0_0 = "host_0_0";
     String rack_0 = "rack_0";
-    SchedulerNode node_0_0 = TestUtils.getMockNode(host_0_0, rack_0, 0, 8*GB);
+    FiCaSchedulerNode node_0_0 = TestUtils.getMockNode(host_0_0, rack_0, 0, 8*GB);
     String host_0_1 = "host_0_1";
-    SchedulerNode node_0_1 = TestUtils.getMockNode(host_0_1, rack_0, 0, 8*GB);
+    FiCaSchedulerNode node_0_1 = TestUtils.getMockNode(host_0_1, rack_0, 0, 8*GB);
     
     
     String host_1_0 = "host_1_0";
     String rack_1 = "rack_1";
-    SchedulerNode node_1_0 = TestUtils.getMockNode(host_1_0, rack_1, 0, 8*GB);
+    FiCaSchedulerNode node_1_0 = TestUtils.getMockNode(host_1_0, rack_1, 0, 8*GB);
     
     final int numNodes = 3;
     Resource clusterResource = Resources.createResource(numNodes * (8*GB));

Modified: hadoop/common/trunk/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/trunk/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=1362332&r1=1362331&r2=1362332&view=diff
==============================================================================
--- hadoop/common/trunk/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/trunk/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 17 01:43:03 2012
@@ -44,8 +44,8 @@ import org.apache.hadoop.yarn.conf.YarnC
 import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
 import org.apache.hadoop.yarn.server.resourcemanager.resource.Resources;
 import org.apache.hadoop.yarn.server.resourcemanager.scheduler.NodeType;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApp;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerNode;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -99,22 +99,22 @@ public class TestParentQueue {
     LOG.info("Setup top-level queues a and b");
   }
 
-  private SchedulerApp getMockApplication(int appId, String user) {
-    SchedulerApp application = mock(SchedulerApp.class);
+  private FiCaSchedulerApp getMockApplication(int appId, String user) {
+    FiCaSchedulerApp application = mock(FiCaSchedulerApp.class);
     doReturn(user).when(application).getUser();
     doReturn(Resources.createResource(0)).when(application).getHeadroom();
     return application;
   }
 
   private void stubQueueAllocation(final CSQueue queue, 
-      final Resource clusterResource, final SchedulerNode node, 
+      final Resource clusterResource, final FiCaSchedulerNode node, 
       final int allocation) {
     stubQueueAllocation(queue, clusterResource, node, allocation, 
         NodeType.NODE_LOCAL);
   }
   
   private void stubQueueAllocation(final CSQueue queue, 
-      final Resource clusterResource, final SchedulerNode node, 
+      final Resource clusterResource, final FiCaSchedulerNode node, 
       final int allocation, final NodeType type) {
     
     // Simulate the queue allocation
@@ -132,7 +132,7 @@ public class TestParentQueue {
           ((ParentQueue)queue).allocateResource(clusterResource, 
               allocatedResource);
         } else {
-          SchedulerApp app1 = getMockApplication(0, "");
+          FiCaSchedulerApp app1 = getMockApplication(0, "");
           ((LeafQueue)queue).allocateResource(clusterResource, app1, 
               allocatedResource);
         }
@@ -198,9 +198,9 @@ public class TestParentQueue {
     final int memoryPerNode = 10;
     final int numNodes = 2;
     
-    SchedulerNode node_0 = 
+    FiCaSchedulerNode node_0 = 
         TestUtils.getMockNode("host_0", DEFAULT_RACK, 0, memoryPerNode*GB);
-    SchedulerNode node_1 = 
+    FiCaSchedulerNode node_1 = 
         TestUtils.getMockNode("host_1", DEFAULT_RACK, 0, memoryPerNode*GB);
     
     final Resource clusterResource = 
@@ -224,9 +224,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_1);
     InOrder allocationOrder = inOrder(a, b);
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 2*GB, clusterResource);
     verifyQueueMetrics(b, 2*GB, clusterResource);
 
@@ -237,9 +237,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_0);
     allocationOrder = inOrder(b, a);
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 3*GB, clusterResource);
     verifyQueueMetrics(b, 4*GB, clusterResource);
 
@@ -250,9 +250,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_0);
     allocationOrder = inOrder(b, a);
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 3*GB, clusterResource);
     verifyQueueMetrics(b, 8*GB, clusterResource);
 
@@ -263,9 +263,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_1);
     allocationOrder = inOrder(a, b);
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 4*GB, clusterResource);
     verifyQueueMetrics(b, 9*GB, clusterResource);
   }
@@ -346,11 +346,11 @@ public class TestParentQueue {
     final int memoryPerNode = 10;
     final int numNodes = 3;
     
-    SchedulerNode node_0 = 
+    FiCaSchedulerNode node_0 = 
         TestUtils.getMockNode("host_0", DEFAULT_RACK, 0, memoryPerNode*GB);
-    SchedulerNode node_1 = 
+    FiCaSchedulerNode node_1 = 
         TestUtils.getMockNode("host_1", DEFAULT_RACK, 0, memoryPerNode*GB);
-    SchedulerNode node_2 = 
+    FiCaSchedulerNode node_2 = 
         TestUtils.getMockNode("host_2", DEFAULT_RACK, 0, memoryPerNode*GB);
     
     final Resource clusterResource = 
@@ -401,11 +401,11 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_0);
     InOrder allocationOrder = inOrder(a, c, b);
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(c).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 1*GB, clusterResource);
     verifyQueueMetrics(b, 6*GB, clusterResource);
     verifyQueueMetrics(c, 3*GB, clusterResource);
@@ -427,13 +427,13 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_2);
     allocationOrder = inOrder(a, a2, a1, b, c);
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(a2).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(c).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 3*GB, clusterResource);
     verifyQueueMetrics(b, 8*GB, clusterResource);
     verifyQueueMetrics(c, 4*GB, clusterResource);
@@ -457,9 +457,9 @@ public class TestParentQueue {
     final int memoryPerNode = 10;
     final int numNodes = 2;
     
-    SchedulerNode node_0 = 
+    FiCaSchedulerNode node_0 = 
         TestUtils.getMockNode("host_0", DEFAULT_RACK, 0, memoryPerNode*GB);
-    SchedulerNode node_1 = 
+    FiCaSchedulerNode node_1 = 
         TestUtils.getMockNode("host_1", DEFAULT_RACK, 0, memoryPerNode*GB);
     
     final Resource clusterResource = 
@@ -484,9 +484,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_1);
     InOrder allocationOrder = inOrder(a, b);
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 2*GB, clusterResource);
     verifyQueueMetrics(b, 2*GB, clusterResource);
     
@@ -498,9 +498,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_0);
     allocationOrder = inOrder(b, a);
     allocationOrder.verify(b).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(a).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(a, 2*GB, clusterResource);
     verifyQueueMetrics(b, 4*GB, clusterResource);
 
@@ -523,9 +523,9 @@ public class TestParentQueue {
     final int memoryPerNode = 10;
     final int numNodes = 2;
     
-    SchedulerNode node_0 = 
+    FiCaSchedulerNode node_0 = 
         TestUtils.getMockNode("host_0", DEFAULT_RACK, 0, memoryPerNode*GB);
-    SchedulerNode node_1 = 
+    FiCaSchedulerNode node_1 = 
         TestUtils.getMockNode("host_1", DEFAULT_RACK, 0, memoryPerNode*GB);
     
     final Resource clusterResource = 
@@ -550,9 +550,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_1);
     InOrder allocationOrder = inOrder(b2, b3);
     allocationOrder.verify(b2).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(b3).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(b2, 1*GB, clusterResource);
     verifyQueueMetrics(b3, 2*GB, clusterResource);
     
@@ -564,9 +564,9 @@ public class TestParentQueue {
     root.assignContainers(clusterResource, node_0);
     allocationOrder = inOrder(b3, b2);
     allocationOrder.verify(b3).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     allocationOrder.verify(b2).assignContainers(eq(clusterResource), 
-        any(SchedulerNode.class));
+        any(FiCaSchedulerNode.class));
     verifyQueueMetrics(b2, 1*GB, clusterResource);
     verifyQueueMetrics(b3, 3*GB, clusterResource);
 

Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestUtils.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestUtils.java?rev=1362332&r1=1362331&r2=1362332&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestUtils.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestUtils.java
Tue Jul 17 01:43:03 2012
@@ -44,8 +44,8 @@ import org.apache.hadoop.yarn.server.res
 import org.apache.hadoop.yarn.server.resourcemanager.resource.Resources;
 import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer;
 import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApp;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerNode;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerNode;
 import org.apache.hadoop.yarn.server.resourcemanager.security.ApplicationTokenSecretManager;
 
 public class TestUtils {
@@ -140,7 +140,7 @@ public class TestUtils {
     return applicationAttemptId;
   }
   
-  public static SchedulerNode getMockNode(
+  public static FiCaSchedulerNode getMockNode(
       String host, String rack, int port, int capability) {
     NodeId nodeId = mock(NodeId.class);
     when(nodeId.getHost()).thenReturn(host);
@@ -153,12 +153,12 @@ public class TestUtils {
     when(rmNode.getHostName()).thenReturn(host);
     when(rmNode.getRackName()).thenReturn(rack);
     
-    SchedulerNode node = spy(new SchedulerNode(rmNode));
+    FiCaSchedulerNode node = spy(new FiCaSchedulerNode(rmNode));
     LOG.info("node = " + host + " avail=" + node.getAvailableResource());
     return node;
   }
   
-  public static ContainerId getMockContainerId(SchedulerApp application) {
+  public static ContainerId getMockContainerId(FiCaSchedulerApp application) {
     ContainerId containerId = mock(ContainerId.class);
     doReturn(application.getApplicationAttemptId()).
     when(containerId).getApplicationAttemptId();



Mime
View raw message