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


Java Hamlet.TABLE属性代码示例

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


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

示例1: generateApplicationTable

@Override
protected void generateApplicationTable(Block html,
    UserGroupInformation callerUGI,
    Collection<ApplicationAttemptReport> attempts) {
  // Application Attempt Table
  Hamlet.TBODY<Hamlet.TABLE<Hamlet>> tbody =
      html.table("#attempts").thead().tr().th(".id", "Attempt ID")
          .th(".started", "Started").th(".node", "Node").th(".logs", "Logs")
          .th(".blacklistednodes", "Blacklisted Nodes")._()._().tbody();

  RMApp rmApp = this.rm.getRMContext().getRMApps().get(this.appID);
  if (rmApp == null) {
    return;
  }
  StringBuilder attemptsTableData = new StringBuilder("[\n");
  for (final ApplicationAttemptReport appAttemptReport : attempts) {
    RMAppAttempt rmAppAttempt =
        rmApp.getRMAppAttempt(appAttemptReport.getApplicationAttemptId());
    if (rmAppAttempt == null) {
      continue;
    }
    AppAttemptInfo attemptInfo =
        new AppAttemptInfo(this.rm, rmAppAttempt, rmApp.getUser(),
            WebAppUtils.getHttpSchemePrefix(conf));
    String blacklistedNodesCount = "N/A";
    Set<String> nodes =
        RMAppAttemptBlock.getBlacklistedNodes(rm,
          rmAppAttempt.getAppAttemptId());
    if(nodes != null) {
      blacklistedNodesCount = String.valueOf(nodes.size());
    }
    String nodeLink = attemptInfo.getNodeHttpAddress();
    if (nodeLink != null) {
      nodeLink = WebAppUtils.getHttpSchemePrefix(conf) + nodeLink;
    }
    String logsLink = attemptInfo.getLogsLink();
    attemptsTableData
        .append("[\"<a href='")
        .append(url("appattempt", rmAppAttempt.getAppAttemptId().toString()))
        .append("'>")
        .append(String.valueOf(rmAppAttempt.getAppAttemptId()))
        .append("</a>\",\"")
        .append(attemptInfo.getStartTime())
        .append("\",\"<a ")
        .append(nodeLink == null ? "#" : "href='" + nodeLink)
        .append("'>")
        .append(nodeLink == null ? "N/A" : StringEscapeUtils
            .escapeJavaScript(StringEscapeUtils.escapeHtml(nodeLink)))
        .append("</a>\",\"<a ")
        .append(logsLink == null ? "#" : "href='" + logsLink).append("'>")
        .append(logsLink == null ? "N/A" : "Logs").append("</a>\",").append(
        "\"").append(blacklistedNodesCount).append("\"],\n");
  }
  if (attemptsTableData.charAt(attemptsTableData.length() - 2) == ',') {
    attemptsTableData.delete(attemptsTableData.length() - 2,
        attemptsTableData.length() - 1);
  }
  attemptsTableData.append("]");
  html.script().$type("text/javascript")
      ._("var attemptsTableData=" + attemptsTableData)._();

  tbody._()._();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:63,代码来源:RMAppBlock.java

示例2: generateApplicationTable

@Override
protected void generateApplicationTable(Block html,
    UserGroupInformation callerUGI,
    Collection<ApplicationAttemptReport> attempts) {
  // Application Attempt Table
  Hamlet.TBODY<Hamlet.TABLE<Hamlet>> 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();

  RMApp rmApp = this.rm.getRMContext().getRMApps().get(this.appID);
  if (rmApp == null) {
    return;
  }
  StringBuilder attemptsTableData = new StringBuilder("[\n");
  for (final ApplicationAttemptReport appAttemptReport : attempts) {
    RMAppAttempt rmAppAttempt =
        rmApp.getRMAppAttempt(appAttemptReport.getApplicationAttemptId());
    if (rmAppAttempt == null) {
      continue;
    }
    AppAttemptInfo attemptInfo =
        new AppAttemptInfo(this.rm, rmAppAttempt, rmApp.getUser(),
            WebAppUtils.getHttpSchemePrefix(conf));
    Set<String> nodes = rmAppAttempt.getBlacklistedNodes();
    // nodes which are blacklisted by the application
    String appBlacklistedNodesCount = String.valueOf(nodes.size());
    // nodes which are blacklisted by the RM for AM launches
    String rmBlacklistedNodesCount =
        String.valueOf(rmAppAttempt.getAMBlacklistManager()
          .getBlacklistUpdates().getBlacklistAdditions().size());
    String nodeLink = attemptInfo.getNodeHttpAddress();
    if (nodeLink != null) {
      nodeLink = WebAppUtils.getHttpSchemePrefix(conf) + nodeLink;
    }
    String logsLink = attemptInfo.getLogsLink();
    attemptsTableData
        .append("[\"<a href='")
        .append(url("appattempt", rmAppAttempt.getAppAttemptId().toString()))
        .append("'>")
        .append(String.valueOf(rmAppAttempt.getAppAttemptId()))
        .append("</a>\",\"")
        .append(attemptInfo.getStartTime())
        .append("\",\"<a ")
        .append(nodeLink == null ? "#" : "href='" + nodeLink)
        .append("'>")
        .append(nodeLink == null ? "N/A" : StringEscapeUtils
            .escapeJavaScript(StringEscapeUtils.escapeHtml(nodeLink)))
        .append("</a>\",\"<a ")
        .append(logsLink == null ? "#" : "href='" + logsLink).append("'>")
        .append(logsLink == null ? "N/A" : "Logs").append("</a>\",")
        .append("\"").append(appBlacklistedNodesCount).append("\",")
        .append("\"").append(rmBlacklistedNodesCount).append("\"],\n");
  }
  if (attemptsTableData.charAt(attemptsTableData.length() - 2) == ',') {
    attemptsTableData.delete(attemptsTableData.length() - 2,
        attemptsTableData.length() - 1);
  }
  attemptsTableData.append("]");
  html.script().$type("text/javascript")
      ._("var attemptsTableData=" + attemptsTableData)._();

  tbody._()._();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:67,代码来源:RMAppBlock.java

示例3: doIndex

@VisibleForTesting
protected void doIndex(Hamlet html, String providerName) {
  ClusterDescription clusterStatus = appView.getClusterStatus();
  DIV<Hamlet> div = html.div("general_info")
                        .h1("index_header",
                            "Application: '" + clusterStatus.name + "'");

  UL<DIV<Hamlet>> ul = div.ul();

  ul.li("Total number of containers for application: " + appView.getNumOwnedContainers());
  ul.li("Application created: " +
        getInfoAvoidingNulls(StatusKeys.INFO_CREATE_TIME_HUMAN));
  ul.li("Application last flexed: " + getInfoAvoidingNulls(StatusKeys.INFO_FLEX_TIME_HUMAN));
  ul.li("Application running since: " + getInfoAvoidingNulls(StatusKeys.INFO_LIVE_TIME_HUMAN));
  ul.li("Application HDFS storage path: " + clusterStatus.dataPath);
  ul.li("Application configuration path: " + clusterStatus.originConfigurationPath);

  ul._()._();

  html.div("provider_info").h3(providerName + " specific information");
  ul = div.ul();
  addProviderServiceOptions(providerService, ul, clusterStatus);
  ul._()._();

  html.div("container_instances").h3("Component Instances");

  Hamlet.TABLE<DIV<Hamlet>> table = div.table();
  table.tr()
       .th("Component")
       .th("Desired")
       .th("Actual")
       .th("Outstanding Requests")
       .th("Failed")
       .th("Failed to start")
       ._();

  List<RoleStatus> roleStatuses = appView.cloneRoleStatusList();
  Collections.sort(roleStatuses, new RoleStatus.CompareByName());
  for (RoleStatus status : roleStatuses) {
    table.tr()
         .td(status.getName())
         .th(String.format("%d", status.getDesired()))
         .th(String.format("%d", status.getActual()))
         .th(String.format("%d", status.getRequested()))
         .th(String.format("%d", status.getFailed()))
         .th(String.format("%d", status.getStartFailed()))
          ._();
  }

  table._()._();
}
 
开发者ID:apache,项目名称:incubator-slider,代码行数:51,代码来源:IndexBlock.java


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