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


Java TaskAttemptInfo.getNode方法代码示例

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


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

示例1: render

import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskAttemptInfo; //导入方法依赖的package包/类
@Override
protected void render(Block html) {
  if (!isValidRequest()) {
    html.
      h2($(TITLE));
    return;
  }
  TBODY<TABLE<Hamlet>> tbody = html.
  table("#attempts").
    thead().
      tr().
        th(".id", "Attempt").
        th(".progress", "Progress").
        th(".state", "State").
        th(".status", "Status").
        th(".node", "Node").
        th(".logs", "Logs").
        th(".tsh", "Started").
        th(".tsh", "Finished").
        th(".tsh", "Elapsed").
        th(".note", "Note")._()._().
  tbody();
  // Write all the data into a JavaScript array of arrays for JQuery
  // DataTables to display
  StringBuilder attemptsTableData = new StringBuilder("[\n");

  for (TaskAttempt attempt : getTaskAttempts()) {
    TaskAttemptInfo ta = new TaskAttemptInfo(attempt, true);
    String progress = percent(ta.getProgress() / 100);

    String nodeHttpAddr = ta.getNode();
    String diag = ta.getNote() == null ? "" : ta.getNote();
    attemptsTableData.append("[\"")
    .append(ta.getId()).append("\",\"")
    .append(progress).append("\",\"")
    .append(ta.getState().toString()).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(
          StringEscapeUtils.escapeHtml(ta.getStatus()))).append("\",\"")

    .append(nodeHttpAddr == null ? "N/A" :
      "<a class='nodelink' href='" + MRWebAppUtil.getYARNWebappScheme() + nodeHttpAddr + "'>"
      + nodeHttpAddr + "</a>")
    .append("\",\"")

    .append(ta.getAssignedContainerId() == null ? "N/A" :
      "<a class='logslink' href='" + url(MRWebAppUtil.getYARNWebappScheme(), nodeHttpAddr, "node"
        , "containerlogs", ta.getAssignedContainerIdStr(), app.getJob()
        .getUserName()) + "'>logs</a>")
      .append("\",\"")

    .append(ta.getStartTime()).append("\",\"")
    .append(ta.getFinishTime()).append("\",\"")
    .append(ta.getElapsedTime()).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      diag))).append("\"],\n");
  }
  //Remove the last comma and close off the array of arrays
  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:naver,项目名称:hadoop,代码行数:68,代码来源:TaskPage.java

示例2: render

import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskAttemptInfo; //导入方法依赖的package包/类
@Override
protected void render(Block html) {
  if (!isValidRequest()) {
    html.
      h2($(TITLE));
    return;
  }
  TBODY<TABLE<Hamlet>> tbody = html.
  table("#attempts").
    thead().
      tr().
        th(".id", "Attempt").
        th(".progress", "Progress").
        th(".state", "State").
        th(".node", "Node").
        th(".logs", "Logs").
        th(".tsh", "Started").
        th(".tsh", "Finished").
        th(".tsh", "Elapsed").
        th(".note", "Note")._()._().
  tbody();
  // Write all the data into a JavaScript array of arrays for JQuery
  // DataTables to display
  StringBuilder attemptsTableData = new StringBuilder("[\n");

  for (TaskAttempt attempt : getTaskAttempts()) {
    TaskAttemptInfo ta = new TaskAttemptInfo(attempt, true);
    String progress = percent(ta.getProgress() / 100);

    String nodeHttpAddr = ta.getNode();
    String diag = ta.getNote() == null ? "" : ta.getNote();
    attemptsTableData.append("[\"")
    .append(ta.getId()).append("\",\"")
    .append(progress).append("\",\"")
    .append(ta.getState().toString()).append("\",\"")

    .append(nodeHttpAddr == null ? "N/A" :
      "<a class='nodelink' href='" + HttpConfig.getSchemePrefix() + nodeHttpAddr + "'>"
      + nodeHttpAddr + "</a>")
    .append("\",\"")

    .append(ta.getAssignedContainerId() == null ? "N/A" :
      "<a class='logslink' href='" + url(HttpConfig.getSchemePrefix(), nodeHttpAddr, "node"
        , "containerlogs", ta.getAssignedContainerIdStr(), app.getJob()
        .getUserName()) + "'>logs</a>")
      .append("\",\"")

    .append(ta.getStartTime()).append("\",\"")
    .append(ta.getFinishTime()).append("\",\"")
    .append(ta.getElapsedTime()).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      diag))).append("\"],\n");
  }
  //Remove the last comma and close off the array of arrays
  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:ict-carch,项目名称:hadoop-plus,代码行数:65,代码来源:TaskPage.java

示例3: render

import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskAttemptInfo; //导入方法依赖的package包/类
@Override
protected void render(Block html) {
  if (!isValidRequest()) {
    html.
      h2($(TITLE));
    return;
  }
  TBODY<TABLE<Hamlet>> tbody = html.
  table("#attempts").
    thead().
      tr().
        th(".id", "Attempt").
        th(".progress", "Progress").
        th(".state", "State").
        th(".node", "Node").
        th(".logs", "Logs").
        th(".tsh", "Started").
        th(".tsh", "Finished").
        th(".tsh", "Elapsed").
        th(".note", "Note")._()._().
  tbody();
  // Write all the data into a JavaScript array of arrays for JQuery
  // DataTables to display
  StringBuilder attemptsTableData = new StringBuilder("[\n");

  for (TaskAttempt attempt : getTaskAttempts()) {
    TaskAttemptInfo ta = new TaskAttemptInfo(attempt, true);
    String progress = percent(ta.getProgress() / 100);

    String nodeHttpAddr = ta.getNode();
    String diag = ta.getNote() == null ? "" : ta.getNote();
    attemptsTableData.append("[\"")
    .append(ta.getId()).append("\",\"")
    .append(progress).append("\",\"")
    .append(ta.getState().toString()).append("\",\"")

    .append(nodeHttpAddr == null ? "N/A" :
      "<a class='nodelink' href='" + MRWebAppUtil.getYARNWebappScheme() + nodeHttpAddr + "'>"
      + nodeHttpAddr + "</a>")
    .append("\",\"")

    .append(ta.getAssignedContainerId() == null ? "N/A" :
      "<a class='logslink' href='" + url(MRWebAppUtil.getYARNWebappScheme(), nodeHttpAddr, "node"
        , "containerlogs", ta.getAssignedContainerIdStr(), app.getJob()
        .getUserName()) + "'>logs</a>")
      .append("\",\"")

    .append(ta.getStartTime()).append("\",\"")
    .append(ta.getFinishTime()).append("\",\"")
    .append(ta.getElapsedTime()).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      diag))).append("\"],\n");
  }
  //Remove the last comma and close off the array of arrays
  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:chendave,项目名称:hadoop-TCP,代码行数:65,代码来源:TaskPage.java

示例4: render

import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskAttemptInfo; //导入方法依赖的package包/类
@Override
protected void render(Block html) {
  if (!isValidRequest()) {
    html.
      h2($(TITLE));
    return;
  }
  TBODY<TABLE<Hamlet>> tbody = html.
  table("#attempts").
    thead().
      tr().
        th(".id", "Attempt").
        th(".progress", "Progress").
        th(".state", "State").
        th(".status", "Status").
        th(".node", "Node").
        th(".logs", "Logs").
        th(".tsh", "Started").
        th(".tsh", "Finished").
        th(".tsh", "Elapsed").
        th(".note", "Note")._()._().
  tbody();
  // Write all the data into a JavaScript array of arrays for JQuery
  // DataTables to display
  StringBuilder attemptsTableData = new StringBuilder("[\n");

  for (TaskAttempt attempt : getTaskAttempts()) {
    TaskAttemptInfo ta = new TaskAttemptInfo(attempt, true);
    String progress = percent(ta.getProgress() / 100);

    String nodeHttpAddr = ta.getNode();
    String diag = ta.getNote() == null ? "" : ta.getNote();
    attemptsTableData.append("[\"")
    .append(ta.getId()).append("\",\"")
    .append(progress).append("\",\"")
    .append(ta.getState().toString()).append("\",\"")
    .append(ta.getStatus()).append("\",\"")

    .append(nodeHttpAddr == null ? "N/A" :
      "<a class='nodelink' href='" + MRWebAppUtil.getYARNWebappScheme() + nodeHttpAddr + "'>"
      + nodeHttpAddr + "</a>")
    .append("\",\"")

    .append(ta.getAssignedContainerId() == null ? "N/A" :
      "<a class='logslink' href='" + url(MRWebAppUtil.getYARNWebappScheme(), nodeHttpAddr, "node"
        , "containerlogs", ta.getAssignedContainerIdStr(), app.getJob()
        .getUserName()) + "'>logs</a>")
      .append("\",\"")

    .append(ta.getStartTime()).append("\",\"")
    .append(ta.getFinishTime()).append("\",\"")
    .append(ta.getElapsedTime()).append("\",\"")
    .append(StringEscapeUtils.escapeJavaScript(StringEscapeUtils.escapeHtml(
      diag))).append("\"],\n");
  }
  //Remove the last comma and close off the array of arrays
  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:Seagate,项目名称:hadoop-on-lustre2,代码行数:67,代码来源:TaskPage.java


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