hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naganarasimha...@apache.org
Subject hadoop git commit: YARN-4498. Application level node labels stats to be available in REST (addendum patch). Contributed by Bibin A Chundatt.
Date Wed, 09 Nov 2016 23:36:02 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 59ee8b7a8 -> edbee9e60


YARN-4498. Application level node labels stats to be available in REST (addendum patch). Contributed
by Bibin A Chundatt.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/edbee9e6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/edbee9e6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/edbee9e6

Branch: refs/heads/trunk
Commit: edbee9e609e7f31d188660717ff9d3fb9f606abb
Parents: 59ee8b7
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Thu Nov 10 05:00:05 2016 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Thu Nov 10 05:00:05 2016 +0530

----------------------------------------------------------------------
 .../server/resourcemanager/webapp/dao/AppInfo.java    |  4 ++--
 .../webapp/TestRMWebServiceAppsNodelabel.java         | 14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/edbee9e6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
index 3bd6cff..19cbe43 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/AppInfo.java
@@ -111,7 +111,7 @@ public class AppInfo {
   protected String appNodeLabelExpression;
   protected String amNodeLabelExpression;
 
-  protected ResourcesInfo resourceInfo;
+  protected ResourcesInfo resourceInfo = null;
 
   public AppInfo() {
   } // JAXB needs this
@@ -232,7 +232,7 @@ public class AppInfo {
               .getApplicationAttempt(attempt.getAppAttemptId());
           resourceInfo = null != ficaAppAttempt
               ? new ResourcesInfo(ficaAppAttempt.getSchedulingResourceUsage())
-              : new ResourcesInfo();
+              : null;
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/edbee9e6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
index a931b0b..25a712c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
@@ -19,10 +19,11 @@
 package org.apache.hadoop.yarn.server.resourcemanager.webapp;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import javax.ws.rs.core.MediaType;
@@ -153,10 +154,13 @@ public class TestRMWebServiceAppsNodelabel extends JerseyTestBase {
     JSONObject json = response.getEntity(JSONObject.class);
     JSONObject apps = json.getJSONObject("apps");
     assertEquals("incorrect number of elements", 1, apps.length());
-    JSONObject jsonObject =
-        apps.getJSONArray("app").getJSONObject(0).getJSONObject("resourceInfo");
-    Iterator<?> keys = jsonObject.keys();
-    assertEquals("For finshed app no values expected", false, keys.hasNext());
+    try {
+      apps.getJSONArray("app").getJSONObject(0).getJSONObject("resourceInfo");
+      fail("resourceInfo object shouldnt be available for finished apps");
+    } catch (Exception e) {
+      assertTrue("resourceInfo shouldn't be available for finished apps",
+          true);
+    }
     rm.stop();
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message