tbody.tr().td().a("//" + webAppAddress, subClusterId.toString()).__() .td(Integer.toString(subClusterInfo.getAppsSubmitted())) .td(Integer.toString(subClusterInfo.getAppsPending())) .td(Integer.toString(subClusterInfo.getAppsRunning())) .td(Integer.toString(subClusterInfo.getAppsFailed())) .td(Integer.toString(subClusterInfo.getAppsKilled())) .td(Integer.toString(subClusterInfo.getAppsCompleted())) .td(Integer.toString(subClusterInfo.getContainersAllocated())) .td(Integer.toString(subClusterInfo.getReservedContainers())) .td(Integer.toString(subClusterInfo.getPendingContainers())) .td(StringUtils.byteDesc( subClusterInfo.getAvailableMB() * BYTES_IN_MB)) .td(StringUtils.byteDesc( subClusterInfo.getAllocatedMB() * BYTES_IN_MB)) .td(StringUtils.byteDesc( subClusterInfo.getReservedMB() * BYTES_IN_MB)) .td(StringUtils.byteDesc( subClusterInfo.getTotalMB() * BYTES_IN_MB)) .td(Long.toString(subClusterInfo.getAvailableVirtualCores())) .td(Long.toString(subClusterInfo.getAllocatedVirtualCores())) .td(Long.toString(subClusterInfo.getReservedVirtualCores())) .td(Long.toString(subClusterInfo.getTotalVirtualCores())) .td(Integer.toString(subClusterInfo.getActiveNodes())) .td(Integer.toString(subClusterInfo.getLostNodes())) .td(Integer.toString(subClusterInfo.getDecommissionedNodes())) .td(Integer.toString(subClusterInfo.getUnhealthyNodes())) .td(Integer.toString(subClusterInfo.getRebootedNodes())) .td(Integer.toString(subClusterInfo.getTotalNodes())).__();
String val = entry.getValue().toString(); if(task != null) { row.td(id); row.td().br().$title(val).__().__(val).__(); } else { row.td().a(url("singletaskcounter",entry.getKey(), $(COUNTER_GROUP), $(COUNTER_NAME)), id).__(); row.td().br().$title(val).__().a(url("singletaskcounter", entry.getKey(), $(COUNTER_GROUP), $(COUNTER_NAME)), val).__();
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.").__(); .getLogAggregationFailureMessagesForNM(report.getKey()); table.tr() .td(report.getKey().toString()) .td(status == null ? "N/A" : status.toString()) .td(message == null ? "N/A" : message) .td(failureMessage == null ? "N/A" : failureMessage).__();
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())). td(String.valueOf(clusterMetrics.getTotalVirtualCores())). td(String.valueOf(clusterMetrics.getReservedVirtualCores())). __(). __().__(); tbody().$class("ui-widget-content"). tr(). td().a(url("nodes"), String.valueOf(clusterMetrics.getActiveNodes())).__(). td().a(url("nodes/decommissioning"), String.valueOf(clusterMetrics.getDecommissioningNodes())).__(). td().a(url("nodes/decommissioned"), String.valueOf(clusterMetrics.getDecommissionedNodes())).__(). td().a(url("nodes/lost"), String.valueOf(clusterMetrics.getLostNodes())).__(). td().a(url("nodes/unhealthy"), String.valueOf(clusterMetrics.getUnhealthyNodes())).__(). td().a(url("nodes/rebooted"), String.valueOf(clusterMetrics.getRebootedNodes())).__(). td().a(url("nodes/shutdown"), String.valueOf(clusterMetrics.getShutdownNodes())).__(). __().
.$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 = .$class("ui-widget-content") .tr() .td(Times.format(healthInfo.getLastSchedulerRunTime())) .td( healthInfo.getAllocationCount().toString() + " - " + healthInfo.getResourcesAllocated().toString()) .td( healthInfo.getReservationCount().toString() + " - " + healthInfo.getResourcesReserved().toString()) .td( healthInfo.getReleaseCount().toString() + " - " + healthInfo.getResourcesReleased().toString()).__().__().__(); .td(Times.format(di.getTimestamp())).td(containerId).td(nodeId) .td(queue).__().__().__();
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(); 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()). Counter rc = rg == null ? null : rg.findCounter(counter.getName()); groupRow. td(mc == null ? "0" : String.format("%,d", mc.getValue())). td(rc == null ? "0" : String.format("%,d", rc.getValue())); groupRow.td(String.format("%,d", counter.getValue())).__();
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())).__() .__(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(info.getVersion()).__();
tr().th("Column1").th("Column2").__().__(). tbody(). tr().td("c1r1").td("c2r1").__(). tr().td("c1r2").td("c2r2").__().__().__(). h2("Nested tables"). div(_INFO_WRAP). 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").__(). __().__().__().__().__().__().__().__().__();
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())).__();
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). $style(join("width:", job.getReduceProgressPercent(), '%')).__().__().__(). td(String.valueOf(job.getReducesTotal())). td(String.valueOf(job.getReducesCompleted())).__();
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])).__();
for (RMNodeLabel info : nlm.pullRMNodeLabelsInfo()) { TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td(info.getLabelName().isEmpty() ? NodeLabel.DEFAULT_NODE_LABEL_PARTITION : info.getLabelName()); String type = (info.getIsExclusive()) ? "Exclusive Partition" : "Non Exclusive Partition"; row = row.td(type); int nActiveNMs = info.getNumActiveNMs(); if (nActiveNMs > 0) { row = row.td() .a(url("nodes", "?" + YarnWebParams.NODE_LABEL + "=" + info.getLabelName()), .__(); } else { row = row.td(String.valueOf(nActiveNMs)); row.td(info.getResource().toString()).__();
for (String containerIdStr : info.getContainers()) { containersListBody .tr().td() .a(url("container", containerIdStr), containerIdStr) .__().__();
@Override protected void render(Block html) { TBODY<TABLE<BODY<Hamlet>>> tableBody = html.body() .table("#containers") .thead() .tr() .td().__("ContainerId").__() .td().__("ExecutionType").__() .td().__("ContainerState").__() .td().__("logs").__() .__() .__().tbody(); for (Entry<ContainerId, Container> entry : this.nmContext .getContainers().entrySet()) { ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue()); tableBody .tr() .td().a(url("container", info.getId()), info.getId()) .__() .td().__(info.getExecutionType()).__() .td().__(info.getState()).__() .td() .a(url(info.getShortLogLink()), "logs").__() .__(); } tableBody.__().__().__(); }
@Override protected void render(Block html) { TBODY<TABLE<BODY<Hamlet>>> tableBody = html .body() .table("#applications") .thead() .tr() .td().__("ApplicationId").__() .td().__("ApplicationState").__() .__() .__() .tbody(); for (Entry<ApplicationId, Application> entry : this.nmContext .getApplications().entrySet()) { AppInfo info = new AppInfo(entry.getValue()); tableBody .tr() .td().a(url("application", info.getId()), info.getId()).__() .td().__(info.getState()) .__() .__(); } tableBody.__().__().__(); } }
@Override public TR<T> td(String cdata) { return td().__(cdata).__(); }
@Override public TR<T> td(String selector, String cdata) { return setSelector(td(), selector).__(cdata).__(); } }