hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: YARN-6603. NPE in RMAppsBlock. Contributed by Jason Lowe
Date Tue, 16 May 2017 14:30:06 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8.1 717cd78f5 -> e99fd6ae6


YARN-6603. NPE in RMAppsBlock. Contributed by Jason Lowe

(cherry picked from commit 489f85933c508bc26de607b921e56e23b979fce8)


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

Branch: refs/heads/branch-2.8.1
Commit: e99fd6ae69bb2c98463b93e93ba3888eac0c4ba5
Parents: 717cd78
Author: Jason Lowe <jlowe@yahoo-inc.com>
Authored: Tue May 16 09:26:44 2017 -0500
Committer: Jason Lowe <jlowe@yahoo-inc.com>
Committed: Tue May 16 09:29:53 2017 -0500

----------------------------------------------------------------------
 .../server/resourcemanager/webapp/RMAppsBlock.java | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e99fd6ae/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppsBlock.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/RMAppsBlock.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppsBlock.java
index 305f1d5..6a18296 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppsBlock.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppsBlock.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationReport;
 import org.apache.hadoop.yarn.api.records.YarnApplicationState;
 import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt;
 import org.apache.hadoop.yarn.server.webapp.AppsBlock;
 import org.apache.hadoop.yarn.server.webapp.dao.AppInfo;
@@ -96,13 +97,15 @@ public class RMAppsBlock extends AppsBlock {
       }
 
       String blacklistedNodesCount = "N/A";
-      RMAppAttempt appAttempt =
-          rm.getRMContext().getRMApps().get(appAttemptId.getApplicationId())
-              .getAppAttempts().get(appAttemptId);
-      Set<String> nodes =
-          null == appAttempt ? null : appAttempt.getBlacklistedNodes();
-      if (nodes != null) {
-        blacklistedNodesCount = String.valueOf(nodes.size());
+      RMApp rmApp = rm.getRMContext().getRMApps()
+          .get(appAttemptId.getApplicationId());
+      if (rmApp != null) {
+        RMAppAttempt appAttempt = rmApp.getRMAppAttempt(appAttemptId);
+        Set<String> nodes =
+            null == appAttempt ? null : appAttempt.getBlacklistedNodes();
+        if (nodes != null) {
+          blacklistedNodesCount = String.valueOf(nodes.size());
+        }
       }
       String percent = StringUtils.format("%.1f", app.getProgress());
       appsTableData


---------------------------------------------------------------------
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