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:56:46 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 1d75da8e2 -> 108f09a76


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

(cherry picked from commit 8a2998c08c614f9c64f012f40d31404fe9217e63)


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

Branch: refs/heads/branch-2.8
Commit: 108f09a76341485096d1d3a97d2ce87a47293997
Parents: 1d75da8
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Thu Nov 10 05:21:07 2016 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Thu Nov 10 05:24:12 2016 +0530

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/108f09a7/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 a91c212..d35d52b4 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
@@ -106,7 +106,7 @@ public class AppInfo {
   protected String appNodeLabelExpression;
   protected String amNodeLabelExpression;
 
-  protected ResourcesInfo resourceInfo;
+  protected ResourcesInfo resourceInfo = null;
 
   public AppInfo() {
   } // JAXB needs this
@@ -219,7 +219,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/108f09a7/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 5c99614e..0f2b6ea 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,6 +19,8 @@
 package org.apache.hadoop.yarn.server.resourcemanager.webapp;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -157,8 +159,12 @@ public class TestRMWebServiceAppsNodelabel extends JerseyTestBase {
     JSONObject json = response.getEntity(JSONObject.class);
     JSONObject apps = json.getJSONObject("apps");
     assertEquals("incorrect number of elements", 1, apps.length());
-    Object object = apps.getJSONArray("app").getJSONObject(0).get("resourceInfo");
-    Assert.assertTrue("For finshed app null expected", object.equals(null));
+    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