|
@@ -20,9 +20,10 @@ package org.apache.hadoop.yarn.server.resourcemanager.webapp;
|
|
|
|
|
|
import static org.apache.hadoop.yarn.webapp.view.JQueryUI._INFO_WRAP;
|
|
import static org.apache.hadoop.yarn.webapp.view.JQueryUI._INFO_WRAP;
|
|
|
|
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.Set;
|
|
|
|
+
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
-import org.apache.commons.logging.Log;
|
|
|
|
-import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.security.UserGroupInformation;
|
|
import org.apache.hadoop.security.UserGroupInformation;
|
|
import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport;
|
|
import org.apache.hadoop.yarn.api.records.ApplicationAttemptReport;
|
|
@@ -43,12 +44,8 @@ import org.apache.hadoop.yarn.webapp.view.InfoBlock;
|
|
|
|
|
|
import com.google.inject.Inject;
|
|
import com.google.inject.Inject;
|
|
|
|
|
|
-import java.util.Collection;
|
|
|
|
-import java.util.Set;
|
|
|
|
-
|
|
|
|
public class RMAppBlock extends AppBlock{
|
|
public class RMAppBlock extends AppBlock{
|
|
|
|
|
|
- private static final Log LOG = LogFactory.getLog(RMAppBlock.class);
|
|
|
|
private final ResourceManager rm;
|
|
private final ResourceManager rm;
|
|
private final Configuration conf;
|
|
private final Configuration conf;
|
|
|
|
|
|
@@ -116,7 +113,10 @@ public class RMAppBlock extends AppBlock{
|
|
Hamlet.TBODY<Hamlet.TABLE<Hamlet>> tbody =
|
|
Hamlet.TBODY<Hamlet.TABLE<Hamlet>> tbody =
|
|
html.table("#attempts").thead().tr().th(".id", "Attempt ID")
|
|
html.table("#attempts").thead().tr().th(".id", "Attempt ID")
|
|
.th(".started", "Started").th(".node", "Node").th(".logs", "Logs")
|
|
.th(".started", "Started").th(".node", "Node").th(".logs", "Logs")
|
|
- .th(".blacklistednodes", "Blacklisted Nodes")._()._().tbody();
|
|
|
|
|
|
+ .th(".appBlacklistednodes", "Nodes black listed by the application",
|
|
|
|
+ "App Blacklisted Nodes")
|
|
|
|
+ .th(".rmBlacklistednodes", "Nodes black listed by the RM for the"
|
|
|
|
+ + " app", "RM Blacklisted Nodes")._()._().tbody();
|
|
|
|
|
|
RMApp rmApp = this.rm.getRMContext().getRMApps().get(this.appID);
|
|
RMApp rmApp = this.rm.getRMContext().getRMApps().get(this.appID);
|
|
if (rmApp == null) {
|
|
if (rmApp == null) {
|
|
@@ -132,13 +132,12 @@ public class RMAppBlock extends AppBlock{
|
|
AppAttemptInfo attemptInfo =
|
|
AppAttemptInfo attemptInfo =
|
|
new AppAttemptInfo(this.rm, rmAppAttempt, rmApp.getUser(),
|
|
new AppAttemptInfo(this.rm, rmAppAttempt, rmApp.getUser(),
|
|
WebAppUtils.getHttpSchemePrefix(conf));
|
|
WebAppUtils.getHttpSchemePrefix(conf));
|
|
- String blacklistedNodesCount = "N/A";
|
|
|
|
- Set<String> nodes =
|
|
|
|
- RMAppAttemptBlock.getBlacklistedNodes(rm,
|
|
|
|
- rmAppAttempt.getAppAttemptId());
|
|
|
|
- if(nodes != null) {
|
|
|
|
- blacklistedNodesCount = String.valueOf(nodes.size());
|
|
|
|
- }
|
|
|
|
|
|
+ Set<String> nodes = rmAppAttempt.getBlacklistedNodes();
|
|
|
|
+ // nodes which are blacklisted by the application
|
|
|
|
+ String appBlacklistedNodesCount = String.valueOf(nodes.size());
|
|
|
|
+ // nodes which are blacklisted by the RM for AM launches
|
|
|
|
+ String rmBlacklistedNodesCount = String.valueOf(rmAppAttempt
|
|
|
|
+ .getAMBlacklist().getBlacklistUpdates().getAdditions().size());
|
|
String nodeLink = attemptInfo.getNodeHttpAddress();
|
|
String nodeLink = attemptInfo.getNodeHttpAddress();
|
|
if (nodeLink != null) {
|
|
if (nodeLink != null) {
|
|
nodeLink = WebAppUtils.getHttpSchemePrefix(conf) + nodeLink;
|
|
nodeLink = WebAppUtils.getHttpSchemePrefix(conf) + nodeLink;
|
|
@@ -158,8 +157,9 @@ public class RMAppBlock extends AppBlock{
|
|
.escapeJavaScript(StringEscapeUtils.escapeHtml(nodeLink)))
|
|
.escapeJavaScript(StringEscapeUtils.escapeHtml(nodeLink)))
|
|
.append("</a>\",\"<a ")
|
|
.append("</a>\",\"<a ")
|
|
.append(logsLink == null ? "#" : "href='" + logsLink).append("'>")
|
|
.append(logsLink == null ? "#" : "href='" + logsLink).append("'>")
|
|
- .append(logsLink == null ? "N/A" : "Logs").append("</a>\",").append(
|
|
|
|
- "\"").append(blacklistedNodesCount).append("\"],\n");
|
|
|
|
|
|
+ .append(logsLink == null ? "N/A" : "Logs").append("</a>\",")
|
|
|
|
+ .append("\"").append(appBlacklistedNodesCount).append("\",")
|
|
|
|
+ .append("\"").append(rmBlacklistedNodesCount).append("\"],\n");
|
|
}
|
|
}
|
|
if (attemptsTableData.charAt(attemptsTableData.length() - 2) == ',') {
|
|
if (attemptsTableData.charAt(attemptsTableData.length() - 2) == ',') {
|
|
attemptsTableData.delete(attemptsTableData.length() - 2,
|
|
attemptsTableData.delete(attemptsTableData.length() - 2,
|