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


Java ContainerReport.getNodeHttpAddress方法代码示例

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


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

示例1: ContainerInfo

import org.apache.hadoop.yarn.api.records.ContainerReport; //导入方法依赖的package包/类
public ContainerInfo(ContainerReport container) {
  containerId = container.getContainerId().toString();
  if (container.getAllocatedResource() != null) {
    allocatedMB = container.getAllocatedResource().getMemory();
    allocatedVCores = container.getAllocatedResource().getVirtualCores();
    allocatedGCores = container.getAllocatedResource().getGpuCores();
  }
  if (container.getAssignedNode() != null) {
    assignedNodeId = container.getAssignedNode().toString();
  }
  priority = container.getPriority().getPriority();
  startedTime = container.getCreationTime();
  finishedTime = container.getFinishTime();
  elapsedTime = Times.elapsed(startedTime, finishedTime);
  diagnosticsInfo = container.getDiagnosticsInfo();
  logUrl = container.getLogUrl();
  containerExitStatus = container.getContainerExitStatus();
  containerState = container.getContainerState();
  nodeHttpAddress = container.getNodeHttpAddress();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ContainerInfo.java

示例2: ContainerInfo

import org.apache.hadoop.yarn.api.records.ContainerReport; //导入方法依赖的package包/类
public ContainerInfo(ContainerReport container) {
  containerId = container.getContainerId().toString();
  if (container.getAllocatedResource() != null) {
    allocatedMB = container.getAllocatedResource().getMemory();
    allocatedVCores = container.getAllocatedResource().getVirtualCores();
  }
  if (container.getAssignedNode() != null) {
    assignedNodeId = container.getAssignedNode().toString();
  }
  priority = container.getPriority().getPriority();
  startedTime = container.getCreationTime();
  finishedTime = container.getFinishTime();
  elapsedTime = Times.elapsed(startedTime, finishedTime);
  diagnosticsInfo = container.getDiagnosticsInfo();
  logUrl = container.getLogUrl();
  containerExitStatus = container.getContainerExitStatus();
  containerState = container.getContainerState();
  nodeHttpAddress = container.getNodeHttpAddress();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:20,代码来源:ContainerInfo.java

示例3: createApplicationAttemptTable

import org.apache.hadoop.yarn.api.records.ContainerReport; //导入方法依赖的package包/类
protected void createApplicationAttemptTable(Block html,
    Collection<ApplicationAttemptReport> attempts) {
  TBODY<TABLE<Hamlet>> tbody =
      html.table("#attempts").thead().tr().th(".id", "Attempt ID")
        .th(".started", "Started").th(".node", "Node").th(".logs", "Logs")
        ._()._().tbody();

  StringBuilder attemptsTableData = new StringBuilder("[\n");
  for (final ApplicationAttemptReport appAttemptReport : attempts) {
    AppAttemptInfo appAttempt = new AppAttemptInfo(appAttemptReport);
    ContainerReport containerReport = null;
    try {
      final GetContainerReportRequest request =
              GetContainerReportRequest.newInstance(
                    appAttemptReport.getAMContainerId());
      if (callerUGI == null) {
        containerReport =
            appBaseProt.getContainerReport(request).getContainerReport();
      } else {
        containerReport = callerUGI.doAs(
            new PrivilegedExceptionAction<ContainerReport> () {
          @Override
          public ContainerReport run() throws Exception {
            ContainerReport report = null;
            try {
              report = appBaseProt.getContainerReport(request)
                  .getContainerReport();
            } catch (ContainerNotFoundException ex) {
              LOG.warn(ex.getMessage());
            }
            return report;
          }
        });
      }
    } catch (Exception e) {
      String message =
          "Failed to read the AM container of the application attempt "
              + appAttemptReport.getApplicationAttemptId() + ".";
      LOG.error(message, e);
      html.p()._(message)._();
      return;
    }
    long startTime = 0L;
    String logsLink = null;
    String nodeLink = null;
    if (containerReport != null) {
      ContainerInfo container = new ContainerInfo(containerReport);
      startTime = container.getStartedTime();
      logsLink = containerReport.getLogUrl();
      nodeLink = containerReport.getNodeHttpAddress();
    }
    attemptsTableData
      .append("[\"<a href='")
      .append(url("appattempt", appAttempt.getAppAttemptId()))
      .append("'>")
      .append(appAttempt.getAppAttemptId())
      .append("</a>\",\"")
      .append(startTime)
      .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>\"],\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:naver,项目名称:hadoop,代码行数:78,代码来源:AppBlock.java

示例4: generateApplicationTable

import org.apache.hadoop.yarn.api.records.ContainerReport; //导入方法依赖的package包/类
protected void generateApplicationTable(Block html,
    UserGroupInformation callerUGI,
    Collection<ApplicationAttemptReport> attempts) {
  // Application Attempt Table
  TBODY<TABLE<Hamlet>> tbody =
      html.table("#attempts").thead().tr().th(".id", "Attempt ID")
        .th(".started", "Started").th(".node", "Node").th(".logs", "Logs")
        ._()._().tbody();

  StringBuilder attemptsTableData = new StringBuilder("[\n");
  for (final ApplicationAttemptReport appAttemptReport : attempts) {
    AppAttemptInfo appAttempt = new AppAttemptInfo(appAttemptReport);
    ContainerReport containerReport;
    try {
      final GetContainerReportRequest request =
              GetContainerReportRequest.newInstance(
                    appAttemptReport.getAMContainerId());
      if (callerUGI == null) {
        containerReport =
            appBaseProt.getContainerReport(request).getContainerReport();
      } else {
        containerReport = callerUGI.doAs(
            new PrivilegedExceptionAction<ContainerReport>() {
          @Override
          public ContainerReport run() throws Exception {
            ContainerReport report = null;
            if (request.getContainerId() != null) {
                try {
                  report = appBaseProt.getContainerReport(request)
                      .getContainerReport();
                } catch (ContainerNotFoundException ex) {
                  LOG.warn(ex.getMessage());
                }
            }
            return report;
          }
        });
      }
    } catch (Exception e) {
      String message =
          "Failed to read the AM container of the application attempt "
              + appAttemptReport.getApplicationAttemptId() + ".";
      LOG.error(message, e);
      html.p()._(message)._();
      return;
    }
    long startTime = 0L;
    String logsLink = null;
    String nodeLink = null;
    if (containerReport != null) {
      ContainerInfo container = new ContainerInfo(containerReport);
      startTime = container.getStartedTime();
      logsLink = containerReport.getLogUrl();
      nodeLink = containerReport.getNodeHttpAddress();
    }
    attemptsTableData
      .append("[\"<a href='")
      .append(url("appattempt", appAttempt.getAppAttemptId()))
      .append("'>")
      .append(appAttempt.getAppAttemptId())
      .append("</a>\",\"")
      .append(startTime)
      .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>\"],\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,代码行数:82,代码来源:AppBlock.java

示例5: createApplicationAttemptTable

import org.apache.hadoop.yarn.api.records.ContainerReport; //导入方法依赖的package包/类
protected void createApplicationAttemptTable(Block html,
    Collection<ApplicationAttemptReport> attempts) {
  TBODY<TABLE<Hamlet>> tbody =
      html.table("#attempts").thead().tr().th(".id", "Attempt ID")
        .th(".started", "Started").th(".node", "Node").th(".logs", "Logs")
        ._()._().tbody();

  StringBuilder attemptsTableData = new StringBuilder("[\n");
  for (final ApplicationAttemptReport appAttemptReport : attempts) {
    AppAttemptInfo appAttempt = new AppAttemptInfo(appAttemptReport);
    ContainerReport containerReport = null;
    try {
      // AM container is always the first container of the attempt
      final GetContainerReportRequest request =
          GetContainerReportRequest.newInstance(ContainerId.newContainerId(
            appAttemptReport.getApplicationAttemptId(), 1));
      if (callerUGI == null) {
        containerReport =
            appBaseProt.getContainerReport(request).getContainerReport();
      } else {
        containerReport = callerUGI.doAs(
            new PrivilegedExceptionAction<ContainerReport> () {
          @Override
          public ContainerReport run() throws Exception {
            ContainerReport report = null;
            try {
              report = appBaseProt.getContainerReport(request)
                  .getContainerReport();
            } catch (ContainerNotFoundException ex) {
              LOG.warn(ex.getMessage());
            }
            return report;
          }
        });
      }
    } catch (Exception e) {
      String message =
          "Failed to read the AM container of the application attempt "
              + appAttemptReport.getApplicationAttemptId() + ".";
      LOG.error(message, e);
      html.p()._(message)._();
      return;
    }
    long startTime = 0L;
    String logsLink = null;
    String nodeLink = null;
    if (containerReport != null) {
      ContainerInfo container = new ContainerInfo(containerReport);
      startTime = container.getStartedTime();
      logsLink = containerReport.getLogUrl();
      nodeLink = containerReport.getNodeHttpAddress();
    }
    attemptsTableData
      .append("[\"<a href='")
      .append(url("appattempt", appAttempt.getAppAttemptId()))
      .append("'>")
      .append(appAttempt.getAppAttemptId())
      .append("</a>\",\"")
      .append(startTime)
      .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>\"],\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:yncxcw,项目名称:big-c,代码行数:79,代码来源:AppBlock.java


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