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/RMAppBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java index d2604009f0..838847a362 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppBlock.java @@ -142,7 +142,7 @@ protected void generateApplicationTable(Block html, continue; } AppAttemptInfo attemptInfo = - new AppAttemptInfo(this.rm, rmAppAttempt, rmApp.getUser(), + new AppAttemptInfo(this.rm, rmAppAttempt, true, rmApp.getUser(), WebAppUtils.getHttpSchemePrefix(conf)); Set nodes = rmAppAttempt.getBlacklistedNodes(); // nodes which are blacklisted by the application 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/RMWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java index 2a725cf20c..d5958f5bf3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebServices.java @@ -1127,7 +1127,7 @@ public AppAttemptsInfo getAppAttempts(@Context HttpServletRequest hsr, AppAttemptsInfo appAttemptsInfo = new AppAttemptsInfo(); for (RMAppAttempt attempt : app.getAppAttempts().values()) { AppAttemptInfo attemptInfo = new AppAttemptInfo(rm, attempt, - app.getUser(), hsr.getScheme() + "://"); + hasAccess(app, hsr), app.getUser(), hsr.getScheme() + "://"); appAttemptsInfo.add(attemptInfo); } 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/AppAttemptInfo.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/AppAttemptInfo.java index 66381f4e7e..00454afe0e 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/AppAttemptInfo.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/AppAttemptInfo.java @@ -51,8 +51,8 @@ public class AppAttemptInfo { public AppAttemptInfo() { } - public AppAttemptInfo(ResourceManager rm, RMAppAttempt attempt, String user, - String schemePrefix) { + public AppAttemptInfo(ResourceManager rm, RMAppAttempt attempt, + Boolean hasAccess, String user, String schemePrefix) { this.startTime = 0; this.containerId = ""; this.nodeHttpAddress = ""; @@ -65,7 +65,7 @@ public AppAttemptInfo(ResourceManager rm, RMAppAttempt attempt, String user, this.startTime = attempt.getStartTime(); this.finishedTime = attempt.getFinishTime(); Container masterContainer = attempt.getMasterContainer(); - if (masterContainer != null) { + if (masterContainer != null && hasAccess) { this.containerId = masterContainer.getId().toString(); this.nodeHttpAddress = masterContainer.getNodeHttpAddress(); this.nodeId = masterContainer.getNodeId().toString();