当前位置: 首页>>代码示例>>Java>>正文


Java TABLE._属性代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE._属性的典型用法代码示例。如果您正苦于以下问题:Java TABLE._属性的具体用法?Java TABLE._怎么用?Java TABLE._使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE的用法示例。


在下文中一共展示了TABLE._属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: render

@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);
  }
}
 
开发者ID:Tencent,项目名称:angel,代码行数:23,代码来源:WorkerCounterBlock.java

示例2: render

@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._();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ApplicationPage.java

示例3: render

@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._();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:19,代码来源:ApplicationPage.java

示例4: createContainerLocalityTable

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._();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:40,代码来源:RMAppAttemptBlock.java

示例5: createResourceRequestsTable

private void createResourceRequestsTable(Block html) {
  AppInfo app =
      new AppInfo(rm, rm.getRMContext().getRMApps()
        .get(this.appAttemptId.getApplicationId()), true,
        WebAppUtils.getHttpSchemePrefix(conf));

  List<ResourceRequest> resourceRequests = app.getResourceRequests();
  if (resourceRequests == null || resourceRequests.isEmpty()) {
    return;
  }

  DIV<Hamlet> div = html.div(_INFO_WRAP);
  TABLE<DIV<Hamlet>> table =
      div.h3("Total Outstanding Resource Requests: "
        + getTotalResource(resourceRequests)).table(
            "#ResourceRequests");

  table.tr().
    th(_TH, "Priority").
    th(_TH, "ResourceName").
    th(_TH, "Capability").
    th(_TH, "NumContainers").
    th(_TH, "RelaxLocality").
    th(_TH, "NodeLabelExpression").
  _();

  boolean odd = false;
  for (ResourceRequest request : resourceRequests) {
    if (request.getNumContainers() == 0) {
      continue;
    }
    table.tr((odd = !odd) ? _ODD : _EVEN)
      .td(String.valueOf(request.getPriority()))
      .td(request.getResourceName())
      .td(String.valueOf(request.getCapability()))
      .td(String.valueOf(request.getNumContainers()))
      .td(String.valueOf(request.getRelaxLocality()))
      .td(request.getNodeLabelExpression() == null ? "N/A" : request
          .getNodeLabelExpression())._();
  }
  table._();
  div._();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:43,代码来源:RMAppAttemptBlock.java


注:本文中的org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE._属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。