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


Java FairSchedulerInfo.INVALID_FAIR_SHARE属性代码示例

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


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

示例1: render

@Override public void render(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(".fairshare", "Fair Share").
          th(".starttime", "StartTime").
          th(".finishtime", "FinishTime").
          th(".state", "State").
          th(".finalstatus", "FinalStatus").
          th(".progress", "Progress").
          th(".ui", "Tracking UI")._()._().
      tbody();
  Collection<YarnApplicationState> reqAppStates = null;
  String reqStateString = $(APP_STATE);
  if (reqStateString != null && !reqStateString.isEmpty()) {
    String[] appStateStrings = reqStateString.split(",");
    reqAppStates = new HashSet<YarnApplicationState>(appStateStrings.length);
    for(String stateString : appStateStrings) {
      reqAppStates.add(YarnApplicationState.valueOf(stateString));
    }
  }
  StringBuilder appsTableData = new StringBuilder("[\n");
  for (RMApp app : apps.values()) {
    if (reqAppStates != null && !reqAppStates.contains(app.createApplicationState())) {
      continue;
    }
    AppInfo appInfo = new AppInfo(rm, app, true, WebAppUtils.getHttpSchemePrefix(conf));
    String percent = String.format("%.1f", appInfo.getProgress());
    ApplicationAttemptId attemptId = app.getCurrentAppAttempt().getAppAttemptId();
    int fairShare = fsinfo.getAppFairShare(attemptId);
    if (fairShare == FairSchedulerInfo.INVALID_FAIR_SHARE) {
      // FairScheduler#applications don't have the entry. Skip it.
      continue;
    }
    appsTableData.append("[\"<a href='")
    .append(url("app", appInfo.getAppId())).append("'>")
    .append(appInfo.getAppId()).append("</a>\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      appInfo.getUser()))).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      appInfo.getName()))).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      appInfo.getApplicationType()))).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      appInfo.getQueue()))).append("\",\"")
    .append(fairShare).append("\",\"")
    .append(appInfo.getStartTime()).append("\",\"")
    .append(appInfo.getFinishTime()).append("\",\"")
    .append(appInfo.getState()).append("\",\"")
    .append(appInfo.getFinalStatus()).append("\",\"")
    // Progress bar
    .append("<br title='").append(percent)
    .append("'> <div class='").append(C_PROGRESSBAR).append("' title='")
    .append(join(percent, '%')).append("'> ").append("<div class='")
    .append(C_PROGRESSBAR_VALUE).append("' style='")
    .append(join("width:", percent, '%')).append("'> </div> </div>")
    .append("\",\"<a href='");

    String trackingURL =
      !appInfo.isTrackingUrlReady()? "#" : appInfo.getTrackingUrlPretty();
    
    appsTableData.append(trackingURL).append("'>")
    .append(appInfo.getTrackingUI()).append("</a>\"],\n");

  }
  if(appsTableData.charAt(appsTableData.length() - 2) == ',') {
    appsTableData.delete(appsTableData.length()-2, appsTableData.length()-1);
  }
  appsTableData.append("]");
  html.script().$type("text/javascript").
  _("var appsTableData=" + appsTableData)._();

  tbody._()._();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:80,代码来源:FairSchedulerAppsBlock.java


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