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/NodesPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java index 960346827b..706342196b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java @@ -18,8 +18,8 @@ package org.apache.hadoop.yarn.server.resourcemanager.webapp; -import static org.apache.hadoop.yarn.webapp.YarnWebParams.NODE_STATE; import static org.apache.hadoop.yarn.webapp.YarnWebParams.NODE_LABEL; +import static org.apache.hadoop.yarn.webapp.YarnWebParams.NODE_STATE; import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES; import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID; import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID; @@ -40,7 +40,6 @@ import org.apache.hadoop.yarn.webapp.hamlet.Hamlet; import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TBODY; -import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TR; import org.apache.hadoop.yarn.webapp.view.HtmlBlock; import com.google.inject.Inject; @@ -101,6 +100,7 @@ protected void render(Block html) { LOG.debug("Unexpected state filter for inactive RM node"); } } + StringBuilder nodeTableData = new StringBuilder("[\n"); for (RMNode ni : rmNodes) { if (stateFilter != null) { NodeState state = ni.getState(); @@ -129,27 +129,40 @@ protected void render(Block html) { NodeInfo info = new NodeInfo(ni, sched); int usedMemory = (int) info.getUsedMemory(); int availableMemory = (int) info.getAvailableMemory(); - TR
>> row = - tbody.tr().td(StringUtils.join(",", info.getNodeLabels())) - .td(info.getRack()).td(info.getState()).td(info.getNodeId()); + nodeTableData.append("[\"") + .append(StringUtils.join(",", info.getNodeLabels())).append("\",\"") + .append(info.getRack()).append("\",\"").append(info.getState()) + .append("\",\"").append(info.getNodeId()); if (isInactive) { - row.td()._("N/A")._(); + nodeTableData.append("\",\"").append("N/A").append("\",\""); } else { String httpAddress = info.getNodeHTTPAddress(); - row.td().a("//" + httpAddress, httpAddress)._(); + nodeTableData.append("\",\"").append(httpAddress).append("\",").append("\""); } - row.td().br().$title(String.valueOf(info.getLastHealthUpdate()))._() - ._(Times.format(info.getLastHealthUpdate()))._() - .td(info.getHealthReport()) - .td(String.valueOf(info.getNumContainers())).td().br() - .$title(String.valueOf(usedMemory))._() - ._(StringUtils.byteDesc(usedMemory * BYTES_IN_MB))._().td().br() - .$title(String.valueOf(availableMemory))._() - ._(StringUtils.byteDesc(availableMemory * BYTES_IN_MB))._() - .td(String.valueOf(info.getUsedVirtualCores())) - .td(String.valueOf(info.getAvailableVirtualCores())) - .td(ni.getNodeManagerVersion())._(); + nodeTableData.append("