|
@@ -42,6 +42,8 @@ import org.apache.hadoop.yarn.webapp.View;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.TABLE;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.TBODY;
|
|
|
+import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.THEAD;
|
|
|
+import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.TR;
|
|
|
|
|
|
import com.google.inject.Inject;
|
|
|
|
|
@@ -49,6 +51,32 @@ public class RMAppsBlock extends AppsBlock {
|
|
|
|
|
|
private ResourceManager rm;
|
|
|
|
|
|
+ /** Columns for the Apps RM page. */
|
|
|
+ static final ColumnHeader[] COLUMNS = {
|
|
|
+ new ColumnHeader(".id", "ID"),
|
|
|
+ new ColumnHeader(".user", "User"),
|
|
|
+ new ColumnHeader(".name", "Name"),
|
|
|
+ new ColumnHeader(".type", "Application Type"),
|
|
|
+ new ColumnHeader(".apptag", "Application Tags"),
|
|
|
+ new ColumnHeader(".queue", "Queue"),
|
|
|
+ new ColumnHeader(".priority", "Application Priority"),
|
|
|
+ new ColumnHeader(".starttime", "StartTime"),
|
|
|
+ new ColumnHeader(".IDlaunchtime", "LaunchTime"),
|
|
|
+ new ColumnHeader(".finishtime", "FinishTime"),
|
|
|
+ new ColumnHeader(".state", "State"),
|
|
|
+ new ColumnHeader(".finalstatus", "FinalStatus"),
|
|
|
+ new ColumnHeader(".runningcontainer", "Running Containers"),
|
|
|
+ new ColumnHeader(".allocatedCpu", "Allocated CPU VCores"),
|
|
|
+ new ColumnHeader(".allocatedMemory", "Allocated Memory MB"),
|
|
|
+ new ColumnHeader(".reservedCpu", "Reserved CPU VCores"),
|
|
|
+ new ColumnHeader(".reservedMemory", "Reserved Memory MB"),
|
|
|
+ new ColumnHeader(".queuePercentage", "% of Queue"),
|
|
|
+ new ColumnHeader(".clusterPercentage", "% of Cluster"),
|
|
|
+ new ColumnHeader(".progress", "Progress"),
|
|
|
+ new ColumnHeader(".ui", "Tracking UI"),
|
|
|
+ new ColumnHeader(".blacklisted", "Blacklisted Nodes"),
|
|
|
+ };
|
|
|
+
|
|
|
@Inject
|
|
|
RMAppsBlock(ResourceManager rm, View.ViewContext ctx) {
|
|
|
super(null, ctx);
|
|
@@ -57,26 +85,12 @@ public class RMAppsBlock extends AppsBlock {
|
|
|
|
|
|
@Override
|
|
|
protected void renderData(Block html) {
|
|
|
- TBODY<TABLE<Hamlet>> tbody =
|
|
|
- html.table("#apps").thead().tr().th(".id", "ID").th(".user", "User")
|
|
|
- .th(".name", "Name").th(".type", "Application Type")
|
|
|
- .th(".apptag", "Application Tags")
|
|
|
- .th(".queue", "Queue").th(".priority", "Application Priority")
|
|
|
- .th(".starttime", "StartTime")
|
|
|
- .th("launchtime", "LaunchTime")
|
|
|
- .th(".finishtime", "FinishTime").th(".state", "State")
|
|
|
- .th(".finalstatus", "FinalStatus")
|
|
|
- .th(".runningcontainer", "Running Containers")
|
|
|
- .th(".allocatedCpu", "Allocated CPU VCores")
|
|
|
- .th(".allocatedMemory", "Allocated Memory MB")
|
|
|
- .th(".reservedCpu", "Reserved CPU VCores")
|
|
|
- .th(".reservedMemory", "Reserved Memory MB")
|
|
|
- .th(".queuePercentage", "% of Queue")
|
|
|
- .th(".clusterPercentage", "% of Cluster")
|
|
|
- .th(".progress", "Progress")
|
|
|
- .th(".ui", "Tracking UI")
|
|
|
- .th(".blacklisted", "Blacklisted Nodes").__()
|
|
|
- .__().tbody();
|
|
|
+
|
|
|
+ TR<THEAD<TABLE<Hamlet>>> tr = html.table("#apps").thead().tr();
|
|
|
+ for (ColumnHeader col : COLUMNS) {
|
|
|
+ tr = tr.th(col.getSelector(), col.getCData());
|
|
|
+ }
|
|
|
+ TBODY<TABLE<Hamlet>> tbody = tr.__().__().tbody();
|
|
|
|
|
|
StringBuilder appsTableData = new StringBuilder("[\n");
|
|
|
for (ApplicationReport appReport : appReports) {
|