本文整理汇总了Java中org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE类的典型用法代码示例。如果您正苦于以下问题:Java TABLE类的具体用法?Java TABLE怎么用?Java TABLE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TABLE类属于org.apache.hadoop.yarn.webapp.hamlet.Hamlet包,在下文中一共展示了TABLE类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
set(TITLE, join("Angel WorkerCounterBlock", $(WORKER_ATTEMPT_ID)));
try {
WorkerAttemptId workerAttemptId = new WorkerAttemptId($(WORKER_ATTEMPT_ID));
Map<String, String> metricsMap =
amContext.getWorkerManager().getWorker(workerAttemptId.getWorkerId())
.getWorkerAttempt(workerAttemptId).getMetrics();
TABLE<Hamlet> worker_metrics_table = html.table();
html.h6($(WORKER_ATTEMPT_ID));
worker_metrics_table.tr().th(_TH, "NAME").th(_TH, "VALUE")._();
for (String key : metricsMap.keySet()) {
String value = metricsMap.get(key);
worker_metrics_table.tr().td(String.valueOf(key)).td(value)._();
}
worker_metrics_table._();
} catch (UnvalidIdStrException e) {
LOG.error("unvalid id string, ", e);
}
}
示例2: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
set(TITLE, join("Angel ExecutorsBlock"));
TBODY<TABLE<Hamlet>> tbody =
html.h1("ExecutorsBlock").table("#jobs").thead().tr().th(_TH, "id").th(_TH, "name")
.th(_TH, "state").th(_TH, "stacktrace")._()._().tbody();
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
ThreadInfo[] threadInfo = threadMXBean.dumpAllThreads(true, true);
StringBuilder stackTraceString;
for (ThreadInfo t : threadInfo) {
stackTraceString = new StringBuilder();
StackTraceElement[] stackTrace = t.getStackTrace();
for (StackTraceElement s : stackTrace) {
stackTraceString.append(s.toString()).append("\n");
}
tbody.tr().td(String.valueOf(t.getThreadId())).td(String.valueOf(t.getThreadName()))
.td(String.valueOf(t.getThreadState())).td(String.valueOf(stackTraceString.toString()))._();
}
tbody._()._();
}
示例3: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@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._()._()._();
}
示例4: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
ApplicationId applicationID =
ConverterUtils.toApplicationId(this.recordFactory,
$(APPLICATION_ID));
Application app = this.nmContext.getApplications().get(applicationID);
AppInfo info = new AppInfo(app);
info("Application's information")
._("ApplicationId", info.getId())
._("ApplicationState", info.getState())
._("User", info.getUser());
TABLE<Hamlet> containersListBody = html._(InfoBlock.class)
.table("#containers");
for (String containerIdStr : info.getContainers()) {
containersListBody
.tr().td()
.a(url("container", containerIdStr), containerIdStr)
._()._();
}
containersListBody._();
}
示例5: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
TBODY<TABLE<BODY<Hamlet>>> tableBody = html.body()
.table("#containers")
.thead()
.tr()
.td()._("ContainerId")._()
.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.getState())._()
.td()
.a(url(info.getShortLogLink()), "logs")._()
._();
}
tableBody._()._()._();
}
示例6: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
ApplicationId applicationID = ApplicationId.fromString($(APPLICATION_ID));
Application app = this.nmContext.getApplications().get(applicationID);
AppInfo info = new AppInfo(app);
info("Application's information")
._("ApplicationId", info.getId())
._("ApplicationState", info.getState())
._("User", info.getUser());
TABLE<Hamlet> containersListBody = html._(InfoBlock.class)
.table("#containers");
for (String containerIdStr : info.getContainers()) {
containersListBody
.tr().td()
.a(url("container", containerIdStr), containerIdStr)
._()._();
}
containersListBody._();
}
示例7: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@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")._("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();
ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
for (UserInfo userInfo : users) {
tbody.tr().td(userInfo.getUsername())
.td(userInfo.getUserResourceLimit().toString())
.td(userInfo.getResourcesUsed().toString())
.td(lqinfo.getUserAMResourceLimit().toString())
.td(userInfo.getAMResourcesUsed().toString())
.td(Integer.toString(userInfo.getNumActiveApplications()))
.td(Integer.toString(userInfo.getNumPendingApplications()))._();
}
html.div().$class("usersinfo").h5("Active Users Info")._();
tbody._()._();
}
示例8: createContainerLocalityTable
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
private void createContainerLocalityTable(Block html) {
RMAppAttemptMetrics attemptMetrics = null;
RMAppAttempt attempt = getRMAppAttempt();
if (attempt != null) {
attemptMetrics = attempt.getRMAppAttemptMetrics();
}
if (attemptMetrics == null) {
return;
}
DIV<Hamlet> div = html.div(_INFO_WRAP);
TABLE<DIV<Hamlet>> table =
div.h3(
"Total Allocated Containers: "
+ attemptMetrics.getTotalAllocatedContainers()).h3("Each table cell"
+ " represents the number of NodeLocal/RackLocal/OffSwitch containers"
+ " satisfied by NodeLocal/RackLocal/OffSwitch resource requests.").table(
"#containerLocality");
table.
tr().
th(_TH, "").
th(_TH, "Node Local Request").
th(_TH, "Rack Local Request").
th(_TH, "Off Switch Request").
_();
String[] containersType =
{ "Num Node Local Containers (satisfied by)", "Num Rack Local Containers (satisfied by)",
"Num Off Switch Containers (satisfied by)" };
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]))._();
}
table._();
div._();
}
示例9: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
TBODY<TABLE<Hamlet>> tbody = html.table("#nodelabels").
thead().
tr().
th(".name", "Label Name").
th(".numOfActiveNMs", "Num Of Active NMs").
th(".totalResource", "Total Resource").
_()._().
tbody();
RMNodeLabelsManager nlm = rm.getRMContext().getNodeLabelManager();
for (NodeLabel info : nlm.pullRMNodeLabelsInfo()) {
TR<TBODY<TABLE<Hamlet>>> row =
tbody.tr().td(
info.getLabelName().isEmpty() ? "<NO_LABEL>" : info
.getLabelName());
int nActiveNMs = info.getNumActiveNMs();
if (nActiveNMs > 0) {
row = row.td()
.a(url("nodes",
"?" + YarnWebParams.NODE_LABEL + "=" + info.getLabelName()),
String.valueOf(nActiveNMs))
._();
} else {
row = row.td(String.valueOf(nActiveNMs));
}
row.td(info.getResource().toString())._();
}
tbody._()._();
}
示例10: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override protected void render(Block html) {
if (job == null) {
html.
p()._("Sorry, no counters for nonexistent", $(JOB_ID, "job"))._();
return;
}
if (!$(TASK_ID).isEmpty() && task == null) {
html.
p()._("Sorry, no counters for nonexistent", $(TASK_ID, "task"))._();
return;
}
String columnType = task == null ? "Task" : "Task Attempt";
TBODY<TABLE<DIV<Hamlet>>> tbody = html.
div(_INFO_WRAP).
table("#singleCounter").
thead().
tr().
th(".ui-state-default", columnType).
th(".ui-state-default", "Value")._()._().
tbody();
for (Map.Entry<String, Long> entry : values.entrySet()) {
TR<TBODY<TABLE<DIV<Hamlet>>>> row = tbody.tr();
String id = entry.getKey();
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)._();
}
row._();
}
tbody._()._()._();
}
示例11: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@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")._("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();
ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
for (UserInfo userInfo : users) {
ResourceInfo resourcesUsed = userInfo.getResourcesUsed();
if (nodeLabel != null) {
resourcesUsed = userInfo.getResourceUsageInfo()
.getPartitionResourceUsageInfo(nodeLabel).getUsed();
}
tbody.tr().td(userInfo.getUsername())
.td(userInfo.getUserResourceLimit().toString())
.td(resourcesUsed.toString())
.td(lqinfo.getUserAMResourceLimit().toString())
.td(userInfo.getAMResourcesUsed().toString())
.td(Integer.toString(userInfo.getNumActiveApplications()))
.td(Integer.toString(userInfo.getNumPendingApplications()))._();
}
html.div().$class("usersinfo").h5("Active Users Info")._();
tbody._()._();
}
示例12: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@Override
protected void render(Block html) {
TBODY<TABLE<Hamlet>> tbody = html.table("#nodelabels").
thead().
tr().
th(".name", "Label Name").
th(".type", "Label Type").
th(".numOfActiveNMs", "Num Of Active NMs").
th(".totalResource", "Total Resource").
_()._().
tbody();
RMNodeLabelsManager nlm = rm.getRMContext().getNodeLabelManager();
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()),
String.valueOf(nActiveNMs))
._();
} else {
row = row.td(String.valueOf(nActiveNMs));
}
row.td(info.getResource().toString())._();
}
tbody._()._();
}
示例13: render
import org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE; //导入依赖的package包/类
@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")._("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();
ArrayList<UserInfo> users = lqinfo.getUsers().getUsersList();
for (UserInfo userInfo : users) {
tbody.tr().td(userInfo.getUsername())
.td(userInfo.getUserResourceLimit().toString())
.td(userInfo.getResourcesUsed().toString())
.td(lqinfo.getUserAMResourceLimit().toString())
.td(userInfo.getAMResourcesUsed().toString())
.td(Integer.toString(userInfo.getNumActiveApplications()))
.td(Integer.toString(userInfo.getNumPendingApplications()))._();
}
html.div().$class("usersinfo").h5("Active Users Info")._();
tbody._()._();
}