Hamlet.TR<Hamlet.THEAD<TABLE<Hamlet>>> trbody = html.table("#nodes").thead().tr() .th(".nodelabels", "Node Labels") .th(".rack", "Rack") .th(".state", "Node State") .th(".nodeaddress", "Node Address") .th(".nodehttpaddress", "Node HTTP Address") .th(".lastHealthUpdate", "Last health-update") .th(".healthReport", "Health-report"); trbody.th(".containers", "Containers") .th(".allocationTags", "Allocation Tags") .th(".mem", "Mem Used") .th(".mem", "Mem Avail") .th(".vcores", "VCores Used") .th(".vcores", "VCores Avail"); } else { trbody.th(".containers", "Running Containers (G)") .th(".allocationTags", "Allocation Tags") .th(".mem", "Mem Used (G)") .th(".mem", "Mem Avail (G)") .th(".vcores", "VCores Used (G)") .th(".vcores", "VCores Avail (G)") .th(".containers", "Running Containers (O)") .th(".mem", "Mem Used (O)") .th(".vcores", "VCores Used (O)") .th(".containers", "Queued Containers"); trbody.th(".nodeManagerVersion", "Version").__().__().tbody();
.th(".id", "SubCluster") .th(".submittedA", "Applications Submitted*") .th(".pendingA", "Applications Pending*") .th(".runningA", "Applications Running*") .th(".failedA", "Applications Failed*") .th(".killedA", "Applications Killed*") .th(".completedA", "Applications Completed*") .th(".contAllocated", "Containers Allocated") .th(".contReserved", "Containers Reserved") .th(".contPending", "Containers Pending") .th(".availableM", "Available Memory") .th(".allocatedM", "Allocated Memory") .th(".reservedM", "Reserved Memory") .th(".totalM", "Total Memory") .th(".availableVC", "Available VirtualCores") .th(".allocatedVC", "Allocated VirtualCores") .th(".reservedVC", "Reserved VirtualCores") .th(".totalVC", "Total VirtualCores") .th(".activeN", "Active Nodes") .th(".lostN", "Lost Nodes") .th(".availableN", "Available Nodes") .th(".unhealtyN", "Unhealthy Nodes") .th(".rebootedN", "Rebooted Nodes") .th(".totalN", "Total Nodes") .__().__().tbody(); tbody.tr().td().a("//" + webAppAddress, subClusterId.toString()).__() .td(Integer.toString(subClusterInfo.getAppsSubmitted())) .td(Integer.toString(subClusterInfo.getAppsPending()))
table. tr(). th(amString). __(). tr(). th(_TH, "Attempt Number"). th(_TH, "Start Time"). th(_TH, "Node"). th(_TH, "Logs"). __(); for (AMInfo amInfo : amInfos) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, td(String.valueOf(attempt.getAttemptId())). td(new Date(attempt.getStartTime()).toString()). td().a(".nodelink", url(MRWebAppUtil.getYARNWebappScheme(), attempt.getNodeHttpAddress()), attempt.getNodeHttpAddress()).__(). td().a(".logslink", url(attempt.getLogsLink()), "logs").__(). __(); th(_TH, "Task Type"). th(_TH, "Progress"). th(_TH, "Total"). th(_TH, "Pending"). th(_TH, "Running"). th(_TH, "Complete").__(). tr(_ODD).
@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(".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();
thead().$class("ui-widget-header"). tr(). th().$class("ui-state-default").__("Apps Submitted").__(). th().$class("ui-state-default").__("Apps Pending").__(). th().$class("ui-state-default").__("Apps Running").__(). th().$class("ui-state-default").__("Apps Completed").__(). th().$class("ui-state-default").__("Containers Running").__(). th().$class("ui-state-default").__("Memory Used").__(). th().$class("ui-state-default").__("Memory Total").__(). th().$class("ui-state-default").__("Memory Reserved").__(). th().$class("ui-state-default").__("VCores Used").__(). th().$class("ui-state-default").__("VCores Total").__(). th().$class("ui-state-default").__("VCores Reserved").__(). __(). __(). tbody().$class("ui-widget-content"). tr(). td(String.valueOf(clusterMetrics.getAppsSubmitted())). td(String.valueOf(clusterMetrics.getAppsPending())). td(String.valueOf(clusterMetrics.getAppsRunning())). td( String.valueOf( clusterMetrics.getAppsCompleted() + td(String.valueOf(clusterMetrics.getContainersAllocated())). td(StringUtils.byteDesc(clusterMetrics.getAllocatedMB() * BYTES_IN_MB)). td(StringUtils.byteDesc(clusterMetrics.getTotalMB() * BYTES_IN_MB)). td(StringUtils.byteDesc(clusterMetrics.getReservedMB() * BYTES_IN_MB)). td(String.valueOf(clusterMetrics.getAllocatedVirtualCores())).
tr.th(".id", "Attempt"). th(".progress", "Progress"). th(".state", "State"). th(".status", "Status"). th(".node", "Node"). th(".logs", "Logs"). th(".tsh", "Started"). th(".tsh", "Finished"). th(".tsh", "Elapsed"). th(".note", "Note"); if (enableUIActions) { tr.th(".actions", "Actions"); TBODY<TABLE<Hamlet>> tbody = tr.__().__().tbody();
thead(). tr(). th(".id", "ID"). th(".user", "User"). th(".name", "Name"). th(".type", "Application Type"). th(".queue", "Queue"). th(".fairshare", "Fair Share"). 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(".progress", "Progress"). th(".ui", "Tracking UI").__().__(). tbody(); Collection<YarnApplicationState> reqAppStates = null;
table_description. tr(). th(_TH, "Log Aggregation Status"). th(_TH, "Description"). __(); table_description.tr().td(LogAggregationStatus.DISABLED.name()) .td("Log Aggregation is Disabled.").__(); table_description.tr().td(LogAggregationStatus.NOT_START.name()) .td("Log Aggregation does not Start.").__(); table_description.tr().td(LogAggregationStatus.RUNNING.name()) .td("Log Aggregation is Running.").__(); table_description.tr().td(LogAggregationStatus.RUNNING_WITH_FAILURE.name()) .td("Log Aggregation is Running, but has failures " + "in previous cycles").__(); table_description.tr().td(LogAggregationStatus.SUCCEEDED.name()) .td("Log Aggregation is Succeeded. All of the logs have been " + "aggregated successfully.").__(); table_description.tr().td(LogAggregationStatus.FAILED.name()) .td("Log Aggregation is Failed. At least one of the logs " + "have not been aggregated.").__(); table_description.tr().td(LogAggregationStatus.TIME_OUT.name()) .td("The application is finished, but the log aggregation status is " + "not updated for a long time. Not sure whether the log aggregation " + "is finished or not.").__(); table_description.__(); div_description.__(); table .tr()
div.h4("Aggregate scheduler counts"); TBODY<TABLE<DIV<Hamlet>>> tbody = div.table("#lastrun").thead().$class("ui-widget-header").tr().th() .$class("ui-state-default").__("Total Container Allocations(count)") .__().th().$class("ui-state-default") .__("Total Container Releases(count)").__().th() .$class("ui-state-default") .__("Total Fulfilled Reservations(count)").__().th() .$class("ui-state-default").__("Total Container Preemptions(count)") .__().__().__().tbody(); tbody .$class("ui-widget-content") .tr() .td( String.valueOf(cs.getRootQueueMetrics() .getAggregateAllocatedContainers())) .td( String.valueOf(cs.getRootQueueMetrics() .getAggegatedReleasedContainers())) .td(healthInfo.getAggregateFulFilledReservationsCount().toString()) .td(healthInfo.getAggregatePreemptionCount().toString()).__().__().__(); div.h4("Last scheduler run"); tbody = div.table("#lastrun").thead().$class("ui-widget-header").tr().th() .$class("ui-state-default").__("Time").__().th() .$class("ui-state-default").__("Allocations(count - resources)").__() .th().$class("ui-state-default").__("Reservations(count - resources)") .__().th().$class("ui-state-default").__("Releases(count - resources)") .__().__().__().tbody();
thead(). tr(). th(".group.ui-state-default", "Counter Group"). th(".ui-state-default", "Counters").__().__(). tbody(); for (CounterGroup g : total) { th().$title(g.getName()).$class("ui-state-default"). __(fixGroupDisplayName(g.getDisplayName())).__(). td().$class(C_TABLE). table(".dt-counters").$id(job.getID()+"."+g.getName()). thead(). tr().th(".name", "Name"); groupHeadRow.th("Map").th("Reduce"); th(map == null ? "Value" : "Total").__().__(). tbody(); for (Counter counter : g) { tr(); if (task == null && mg == null && rg == null) { groupRow.td().$title(counter.getName()).__(counter.getDisplayName()). __(); } else { groupRow.td().$title(counter.getName()). a(url(urlBase,urlId,g.getName(), counter.getName()), counter.getDisplayName()).
.th(".id", "ID") .th(".user", "User") .th(".name", "Name") .th(".type", "Application Type") .th(".queue", "Queue") .th(".priority", "Application Priority") .th(".starttime", "StartTime") .th(".finishtime", "FinishTime") .th(".state", "State") .th(".finalstatus", "FinalStatus") .th(".progress", "Progress") .th(".ui", "Tracking UI") .__().__().tbody();
.h3("Total Outstanding Resource Requests: " + getTotalResource(resourceRequests)) .table("#resourceRequests").thead().tr().th(".priority", "Priority") .th(".allocationRequestId", "AllocationRequestId") .th(".resource", "ResourceName").th(".capacity", "Capability") .th(".containers", "NumContainers") .th(".relaxlocality", "RelaxLocality") .th(".labelexpression", "NodeLabelExpression") .th(".executiontype", "ExecutionType") .th(".allocationTags", "AllocationTags") .th(".placementConstraint", "PlacementConstraint").__().__().tbody();
html.table("#attempts").thead().tr().th(".id", "Attempt ID") .th(".started", "Started").th(".node", "Node").th(".logs", "Logs") .th(".appBlacklistednodes", "Nodes blacklisted by the application", "Nodes blacklisted by the app") .th(".rmBlacklistednodes", "Nodes blacklisted by the RM for the" + " app", "Nodes blacklisted by the system").__().__().tbody();
.th(".nodelabels", "Node Labels") .th(".rack", "Rack") .th(".state", "Node State") .th(".nodeaddress", "Node Address") .th(".nodehttpaddress", "Node HTTP Address") .th(".lastHealthUpdate", "Last health-update") .th(".healthReport", "Health-report") .th(".containers", "Containers") .th(".mem", "Mem Used") .th(".mem", "Mem Avail") .th(".vcores", "VCores Used") .th(".vcores", "VCores Avail") .th(".nodeManagerVersion", "Version") .__().__().tbody(); int availableMemory = (int) info.getAvailableMemory(); TR<TBODY<TABLE<Hamlet>>> row = tbody.tr(); row.td().__(StringUtils.join(",", info.getNodeLabels())).__(); row.td().__(info.getRack()).__(); row.td().__(info.getState()).__(); row.td().__(info.getNodeId()).__(); boolean isInactive = false; if (isInactive) { row.td().__("N/A").__(); } else { String httpAddress = info.getNodeHTTPAddress(); row.td().a("//" + httpAddress, httpAddress).__(); row.td().br().$title(String.valueOf(info.getLastHealthUpdate())).__()
thead(). tr(). th(_TH, "key"). th(_TH, "value"). th(_TH, "source chain"). __(). __(). tbody(); td(entry.getName()). td(entry.getValue()). td(buffer.toString()). __(); th().input("search_init").$type(InputType.text).$name("key").$value("key").__().__(). th().input("search_init").$type(InputType.text).$name("value").$value("value").__().__(). th().input("search_init").$type(InputType.text).$name("source chain").$value("source chain").__().__(). __(). __(). __();
table("#t1"). thead(). tr().th("Column1").th("Column2").__().__(). tbody(). tr().td("c1r1").td("c2r1").__(). tr().td("c1r2").td("c2r2").__().__().__(). h2("Nested tables"). div(_INFO_WRAP). table("#t2"). thead(). tr().th(_TH, "Column1").th(_TH, "Column2").__().__(). tbody(). tr().td("r1"). // th wouldn't work as of dt 1.7.5 td().$class(C_TABLE). table("#t3"). thead(). tr().th("SubColumn1").th("SubColumn2").__().__(). tbody(). tr().td("subc1r1").td("subc2r1").__(). tr().td("subc1r2").td("subc2r2").__().__().__().__().__(). tr().td("r2"). // ditto td().$class(C_TABLE). table("#t4"). thead(). tr().th("SubColumn1").th("SubColumn2").__().__(). tbody(). tr().td("subc1r1").td("subc2r1").__(). tr().td("subc1r2").td("subc2r2").__(). __().__().__().__().__().__().__().__().__();
@Override protected void render(Block html) { TBODY<TABLE<Hamlet>> tbody = html.table("#userinfo").thead().$class("ui-widget-header").tr().th() .$class("ui-state-default").__("User Name").__().th() .$class("ui-state-default").__("Max Resource").__().th() .$class("ui-state-default").__("Weight").__().th() .$class("ui-state-default").__("Used Resource").__().th() .$class("ui-state-default").__("Max AM Resource").__().th() .$class("ui-state-default").__("Used AM Resource").__().th() .$class("ui-state-default").__("Schedulable Apps").__().th() .$class("ui-state-default").__("Non-Schedulable Apps").__().__().__() .tbody(); tbody.tr().$style(highlightIfAsking).td(userInfo.getUsername()) .td(userInfo.getUserResourceLimit().toString()) .td(String.valueOf(userInfo.getUserWeight())) .td(resourcesUsed.toString()) .td(userAMLimitPerPartition.toString()) .td(amUsed.toString()) .td(Integer.toString(userInfo.getNumActiveApplications())) .td(Integer.toString(userInfo.getNumPendingApplications())).__();
thead(). tr(). th(".id", "Job ID"). th(".name", "Name"). th(".state", "State"). th("Map Progress"). th("Maps Total"). th("Maps Completed"). th("Reduce Progress"). th("Reduces Total"). th("Reduces Completed").__().__(). tbody(); for (Job j : appContext.getAllJobs().values()) { tbody. tr(). td(). td(job.getName()). td(job.getState()). td(). div(_PROGRESSBAR_VALUE). $style(join("width:", job.getMapProgressPercent(), '%')).__().__().__(). td(String.valueOf(job.getMapsTotal())). td(String.valueOf(job.getMapsCompleted())). td(). div(_PROGRESSBAR_VALUE).
table. tr(). th(_TH, ""). th(_TH, "Node Local Request"). th(_TH, "Rack Local Request"). th(_TH, "Off Switch Request"). __(); boolean odd = false; for (int i = 0; i < attemptMetrics.getLocalityStatistics().length; i++) { table.tr((odd = !odd) ? _ODD : _EVEN).td(containersType[i]) .td(String.valueOf(attemptMetrics.getLocalityStatistics()[i][0])) .td(i == 0 ? "" : String.valueOf(attemptMetrics.getLocalityStatistics()[i][1])) .td(i <= 1 ? "" : String.valueOf(attemptMetrics.getLocalityStatistics()[i][2])).__();