hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1540535 [5/5] - in /hadoop/common/branches/YARN-321/hadoop-yarn-project: ./ hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/ hadoop-yarn/ha...
Date Sun, 10 Nov 2013 20:09:16 GMT
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java?rev=1540535&r1=1540534&r2=1540535&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
(original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
Sun Nov 10 20:09:09 2013
@@ -78,6 +78,8 @@ import com.sun.jersey.test.framework.Web
 public class TestRMWebServicesApps extends JerseyTest {
 
   private static MockRM rm;
+  
+  private static final int CONTAINER_MB = 1024;
 
   private Injector injector = Guice.createInjector(new ServletModule() {
     @Override
@@ -126,7 +128,7 @@ public class TestRMWebServicesApps exten
   public void testApps() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testAppsHelper("apps", app1, MediaType.APPLICATION_JSON);
     rm.stop();
@@ -136,7 +138,7 @@ public class TestRMWebServicesApps exten
   public void testAppsSlash() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testAppsHelper("apps/", app1, MediaType.APPLICATION_JSON);
     rm.stop();
@@ -146,7 +148,7 @@ public class TestRMWebServicesApps exten
   public void testAppsDefault() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testAppsHelper("apps/", app1, "");
     rm.stop();
@@ -156,7 +158,7 @@ public class TestRMWebServicesApps exten
   public void testAppsXML() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024, "testwordcount", "user1");
+    RMApp app1 = rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
@@ -181,7 +183,7 @@ public class TestRMWebServicesApps exten
   public void testAppsXMLMulti() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024, "testwordcount", "user1");
+    rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     rm.submitApp(2048, "testwordcount2", "user1");
 
     amNodeManager.nodeHeartbeat(true);
@@ -225,7 +227,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryState() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -248,8 +250,8 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStates() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    RMApp killedApp = rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    RMApp killedApp = rm.submitApp(CONTAINER_MB);
     rm.killApp(killedApp.getApplicationId());
 
     amNodeManager.nodeHeartbeat(true);
@@ -297,8 +299,8 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStatesComma() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    RMApp killedApp = rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    RMApp killedApp = rm.submitApp(CONTAINER_MB);
     rm.killApp(killedApp.getApplicationId());
 
     amNodeManager.nodeHeartbeat(true);
@@ -346,7 +348,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStatesNone() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -365,7 +367,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStateNone() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -384,7 +386,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStatesInvalid() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -421,7 +423,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStateInvalid() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -458,7 +460,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryFinalStatus() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -481,7 +483,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryFinalStatusNone() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -499,7 +501,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryFinalStatusInvalid() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -537,8 +539,8 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryUser() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
 
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
@@ -565,8 +567,8 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryQueue() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
 
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
@@ -588,9 +590,9 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryLimit() throws JSONException, Exception {
     rm.start();
     rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
         .path("apps").queryParam("limit", "2")
@@ -611,9 +613,9 @@ public class TestRMWebServicesApps exten
     long start = System.currentTimeMillis();
     Thread.sleep(1);
     rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
         .path("apps").queryParam("startedTimeBegin", String.valueOf(start))
@@ -632,11 +634,11 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryStartBeginSome() throws JSONException, Exception {
     rm.start();
     rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     long start = System.currentTimeMillis();
     Thread.sleep(1);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
         .path("apps").queryParam("startedTimeBegin", String.valueOf(start))
@@ -657,9 +659,9 @@ public class TestRMWebServicesApps exten
     rm.registerNode("127.0.0.1:1234", 2048);
     long end = System.currentTimeMillis();
     Thread.sleep(1);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
         .path("apps").queryParam("startedTimeEnd", String.valueOf(end))
@@ -677,11 +679,11 @@ public class TestRMWebServicesApps exten
     rm.registerNode("127.0.0.1:1234", 2048);
     long start = System.currentTimeMillis();
     Thread.sleep(1);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     long end = System.currentTimeMillis();
     Thread.sleep(1);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
         .path("apps").queryParam("startedTimeBegin", String.valueOf(start))
@@ -703,7 +705,7 @@ public class TestRMWebServicesApps exten
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
     long start = System.currentTimeMillis();
     Thread.sleep(1);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     // finish App
     MockAM am = rm
@@ -712,8 +714,8 @@ public class TestRMWebServicesApps exten
     am.unregisterAppAttempt();
     amNodeManager.nodeHeartbeat(app1.getCurrentAppAttempt().getAppAttemptId(),
         1, ContainerState.COMPLETE);
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
 
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
@@ -733,7 +735,7 @@ public class TestRMWebServicesApps exten
   public void testAppsQueryFinishEnd() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     // finish App
     MockAM am = rm
@@ -743,8 +745,8 @@ public class TestRMWebServicesApps exten
     amNodeManager.nodeHeartbeat(app1.getCurrentAppAttempt().getAppAttemptId(),
         1, ContainerState.COMPLETE);
 
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     long end = System.currentTimeMillis();
 
     WebResource r = resource();
@@ -767,7 +769,7 @@ public class TestRMWebServicesApps exten
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
     long start = System.currentTimeMillis();
     Thread.sleep(1);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     // finish App
     MockAM am = rm
@@ -777,8 +779,8 @@ public class TestRMWebServicesApps exten
     amNodeManager.nodeHeartbeat(app1.getCurrentAppAttempt().getAppAttemptId(),
         1, ContainerState.COMPLETE);
 
-    rm.submitApp(1024);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
+    rm.submitApp(CONTAINER_MB);
     long end = System.currentTimeMillis();
 
     WebResource r = resource();
@@ -801,7 +803,7 @@ public class TestRMWebServicesApps exten
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
     Thread.sleep(1);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     // finish App
     MockAM am = rm
@@ -811,9 +813,9 @@ public class TestRMWebServicesApps exten
     amNodeManager.nodeHeartbeat(app1.getCurrentAppAttempt().getAppAttemptId(),
         1, ContainerState.COMPLETE);
 
-    rm.submitApp(1024, "", UserGroupInformation.getCurrentUser()
+    rm.submitApp(CONTAINER_MB, "", UserGroupInformation.getCurrentUser()
         .getShortUserName(), null, false, null, 2, null, "MAPREDUCE");
-    rm.submitApp(1024, "", UserGroupInformation.getCurrentUser()
+    rm.submitApp(CONTAINER_MB, "", UserGroupInformation.getCurrentUser()
         .getShortUserName(), null, false, null, 2, null, "NON-YARN");
 
     WebResource r = resource();
@@ -987,7 +989,7 @@ public class TestRMWebServicesApps exten
       rm.start();
       MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 4096);
       Thread.sleep(1);
-      RMApp app1 = rm.submitApp(1024, "", UserGroupInformation.getCurrentUser()
+      RMApp app1 = rm.submitApp(CONTAINER_MB, "", UserGroupInformation.getCurrentUser()
           .getShortUserName(), null, false, null, 2, null, "MAPREDUCE");
       amNodeManager.nodeHeartbeat(true);
       // finish App
@@ -998,9 +1000,9 @@ public class TestRMWebServicesApps exten
       amNodeManager.nodeHeartbeat(app1.getCurrentAppAttempt().getAppAttemptId(),
           1, ContainerState.COMPLETE);
 
-      rm.submitApp(1024, "", UserGroupInformation.getCurrentUser()
+      rm.submitApp(CONTAINER_MB, "", UserGroupInformation.getCurrentUser()
           .getShortUserName(), null, false, null, 2, null, "MAPREDUCE");
-      rm.submitApp(1024, "", UserGroupInformation.getCurrentUser()
+      rm.submitApp(CONTAINER_MB, "", UserGroupInformation.getCurrentUser()
           .getShortUserName(), null, false, null, 2, null, "OTHER");
 
       // zero type, zero state
@@ -1148,7 +1150,7 @@ public class TestRMWebServicesApps exten
   public void testSingleApp() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024, "testwordcount", "user1");
+    RMApp app1 = rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     testSingleAppsHelper(app1.getApplicationId().toString(), app1,
         MediaType.APPLICATION_JSON);
@@ -1159,7 +1161,7 @@ public class TestRMWebServicesApps exten
   public void testSingleAppsSlash() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testSingleAppsHelper(app1.getApplicationId().toString() + "/", app1,
         MediaType.APPLICATION_JSON);
@@ -1170,7 +1172,7 @@ public class TestRMWebServicesApps exten
   public void testSingleAppsDefault() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testSingleAppsHelper(app1.getApplicationId().toString() + "/", app1, "");
     rm.stop();
@@ -1180,7 +1182,7 @@ public class TestRMWebServicesApps exten
   public void testInvalidApp() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -1216,7 +1218,7 @@ public class TestRMWebServicesApps exten
   public void testNonexistApp() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024, "testwordcount", "user1");
+    rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -1265,7 +1267,7 @@ public class TestRMWebServicesApps exten
   public void testSingleAppsXML() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024, "testwordcount", "user1");
+    RMApp app1 = rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")
@@ -1307,7 +1309,10 @@ public class TestRMWebServicesApps exten
           WebServicesTestUtils.getXmlLong(element, "finishedTime"),
           WebServicesTestUtils.getXmlLong(element, "elapsedTime"),
           WebServicesTestUtils.getXmlString(element, "amHostHttpAddress"),
-          WebServicesTestUtils.getXmlString(element, "amContainerLogs"));
+          WebServicesTestUtils.getXmlString(element, "amContainerLogs"),
+          WebServicesTestUtils.getXmlInt(element, "allocatedMB"),
+          WebServicesTestUtils.getXmlInt(element, "allocatedVCores"),
+          WebServicesTestUtils.getXmlInt(element, "runningContainers"));
     }
   }
 
@@ -1315,7 +1320,7 @@ public class TestRMWebServicesApps exten
       Exception {
 
     // 15 because trackingUrl not assigned yet
-    assertEquals("incorrect number of elements", 16, info.length());
+    assertEquals("incorrect number of elements", 19, info.length());
 
     verifyAppInfoGeneric(app, info.getString("id"), info.getString("user"),
       info.getString("name"), info.getString("applicationType"), info.getString("queue"),
@@ -1324,14 +1329,16 @@ public class TestRMWebServicesApps exten
       info.getString("diagnostics"), info.getLong("clusterId"),
       info.getLong("startedTime"), info.getLong("finishedTime"),
       info.getLong("elapsedTime"), info.getString("amHostHttpAddress"),
-      info.getString("amContainerLogs"));
+      info.getString("amContainerLogs"), info.getInt("allocatedMB"),
+      info.getInt("allocatedVCores"), info.getInt("runningContainers"));
   }
 
   public void verifyAppInfoGeneric(RMApp app, String id, String user,
       String name, String applicationType, String queue, String state, String finalStatus,
       float progress, String trackingUI, String diagnostics, long clusterId,
       long startedTime, long finishedTime, long elapsedTime,
-      String amHostHttpAddress, String amContainerLogs) throws JSONException,
+      String amHostHttpAddress, String amContainerLogs, int allocatedMB,
+      int allocatedVCores, int numContainers) throws JSONException,
       Exception {
 
     WebServicesTestUtils.checkStringMatch("id", app.getApplicationId()
@@ -1363,13 +1370,16 @@ public class TestRMWebServicesApps exten
         amContainerLogs.startsWith("http://"));
     assertTrue("amContainerLogs doesn't contain user info",
         amContainerLogs.endsWith("/" + app.getUser()));
+    assertEquals("allocatedMB doesn't match", 1024, allocatedMB);
+    assertEquals("allocatedVCores doesn't match", 1, allocatedVCores);
+    assertEquals("numContainers doesn't match", 1, numContainers);
   }
 
   @Test
   public void testAppAttempts() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024, "testwordcount", "user1");
+    RMApp app1 = rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     testAppAttemptsHelper(app1.getApplicationId().toString(), app1,
         MediaType.APPLICATION_JSON);
@@ -1380,7 +1390,7 @@ public class TestRMWebServicesApps exten
   public void testMultipleAppAttempts() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024, "testwordcount", "user1");
+    RMApp app1 = rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     int maxAppAttempts = rm.getConfig().getInt(
         YarnConfiguration.RM_AM_MAX_ATTEMPTS,
@@ -1406,7 +1416,7 @@ public class TestRMWebServicesApps exten
   public void testAppAttemptsSlash() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testAppAttemptsHelper(app1.getApplicationId().toString() + "/", app1,
         MediaType.APPLICATION_JSON);
@@ -1417,7 +1427,7 @@ public class TestRMWebServicesApps exten
   public void testAppAttemtpsDefault() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024);
+    RMApp app1 = rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     testAppAttemptsHelper(app1.getApplicationId().toString() + "/", app1, "");
     rm.stop();
@@ -1427,7 +1437,7 @@ public class TestRMWebServicesApps exten
   public void testInvalidAppAttempts() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024);
+    rm.submitApp(CONTAINER_MB);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -1463,7 +1473,7 @@ public class TestRMWebServicesApps exten
   public void testNonexistAppAttempts() throws JSONException, Exception {
     rm.start();
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    rm.submitApp(1024, "testwordcount", "user1");
+    rm.submitApp(CONTAINER_MB, "testwordcount", "user1");
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
 
@@ -1526,7 +1536,7 @@ public class TestRMWebServicesApps exten
     rm.start();
     String user = "user1";
     MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
-    RMApp app1 = rm.submitApp(1024, "testwordcount", user);
+    RMApp app1 = rm.submitApp(CONTAINER_MB, "testwordcount", user);
     amNodeManager.nodeHeartbeat(true);
     WebResource r = resource();
     ClientResponse response = r.path("ws").path("v1").path("cluster")

Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm?rev=1540535&r1=1540534&r2=1540535&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm
(original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/ResourceManagerRest.apt.vm
Sun Nov 10 20:09:09 2013
@@ -1177,7 +1177,10 @@ ResourceManager REST API's.
           "elapsedTime" : 25196,
           "diagnostics" : "",
           "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326815542473_0001/jobhistory/job/job_1326815542473_1_1",
-          "queue" : "default"
+          "queue" : "default",
+          "allocatedMB" : 0,
+          "allocatedVCores" : 0,
+          "runningContainers" : 0
        },
        {
           "finishedTime" : 1326815789546,
@@ -1195,7 +1198,10 @@ ResourceManager REST API's.
           "elapsedTime" : 148166,
           "diagnostics" : "",
           "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326815542473_0002/jobhistory/job/job_1326815542473_2_2",
-          "queue" : "default"
+          "queue" : "default",
+          "allocatedMB" : 0,
+          "allocatedVCores" : 0,
+          "runningContainers" : 1
        } 
     ]
   }
@@ -1245,6 +1251,9 @@ ResourceManager REST API's.
     <amContainerLogs>http://host.domain.com:8042/node/containerlogs/container_1326815542473_0001
 _01_000001</amContainerLogs>
     <amHostHttpAddress>host.domain.com:8042</amHostHttpAddress>
+    <allocatedMB>0</allocatedMB>
+    <allocatedVCores>0</allocatedVCores>
+    <runningContainers>0</runningContainers>
   </app>
   <app>
     <id>application_1326815542473_0002</id>
@@ -1264,6 +1273,9 @@ _01_000001</amContainerLogs>
     <elapsedTime>148166</elapsedTime>
     <amContainerLogs>http://host.domain.com:8042/node/containerlogs/container_1326815542473_0002_01_000001</amContainerLogs>
     <amHostHttpAddress>host.domain.com:8042</amHostHttpAddress>
+    <allocatedMB>0</allocatedMB>
+    <allocatedVCores>0</allocatedVCores>
+    <runningContainers>0</runningContainers>
   </app>
 </apps>
 
@@ -1457,6 +1469,12 @@ _01_000001</amContainerLogs>
 *---------------+--------------+--------------------------------+
 | amHostHttpAddress | string | The nodes http address of the application master |
 *---------------+--------------+--------------------------------+
+| allocatedMB | int | The sum of memory in MB allocated to the application's running containers
|
+*---------------------------------------------------------------+
+| allocatedVCores | int | The sum of virtual cores allocated to the application's running
containers |
++---------------------------------------------------------------+
+| runningContainers | int | The number of containers currently running for the application
|
++---------------------------------------------------------------+
 
 ** Response Examples
 



Mime
View raw message