• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AppAttemptInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AppAttemptInfo类属于org.apache.hadoop.yarn.server.webapp.dao包,在下文中一共展示了AppAttemptInfo类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAppAttempts

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
public AppAttemptsInfo getAppAttempts(HttpServletRequest req,
    HttpServletResponse res, String appId) {
  ApplicationId id = parseApplicationId(appId);
  Collection<ApplicationAttemptReport> appAttemptReports = null;
  try {
    appAttemptReports = appContext.getApplicationAttempts(id).values();
  } catch (IOException e) {
    throw new WebApplicationException(e);
  }
  AppAttemptsInfo appAttemptsInfo = new AppAttemptsInfo();
  for (ApplicationAttemptReport appAttemptReport : appAttemptReports) {
    AppAttemptInfo appAttemptInfo = new AppAttemptInfo(appAttemptReport);
    appAttemptsInfo.add(appAttemptInfo);
  }

  return appAttemptsInfo;
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:18,代码来源:WebServices.java


示例2: getAppAttempt

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
public AppAttemptInfo getAppAttempt(HttpServletRequest req,
    HttpServletResponse res, String appId, String appAttemptId) {
  ApplicationId aid = parseApplicationId(appId);
  ApplicationAttemptId aaid = parseApplicationAttemptId(appAttemptId);
  validateIds(aid, aaid, null);
  ApplicationAttemptReport appAttempt = null;
  try {
    appAttempt = appContext.getApplicationAttempt(aaid);
  } catch (IOException e) {
    throw new WebApplicationException(e);
  }
  if (appAttempt == null) {
    throw new NotFoundException("app attempt with id: " + appAttemptId
        + " not found");
  }
  return new AppAttemptInfo(appAttempt);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:18,代码来源:WebServices.java


示例3: getAppAttempt

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
@GET
@Path("/apps/{appid}/appattempts/{appattemptid}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Override
public AppAttemptInfo getAppAttempt(@Context HttpServletRequest req,
    @Context HttpServletResponse res, @PathParam("appid") String appId,
    @PathParam("appattemptid") String appAttemptId) {
  init(res);
  return super.getAppAttempt(req, res, appId, appAttemptId);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:AHSWebServices.java


示例4: generateOverview

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
protected void generateOverview(ApplicationAttemptReport appAttemptReport,
    Collection<ContainerReport> containers, AppAttemptInfo appAttempt,
    String node) {
  String amContainerId = appAttempt.getAmContainerId();
  info("Application Attempt Overview")
    ._(
      "Application Attempt State:",
      appAttempt.getAppAttemptState() == null ? UNAVAILABLE : appAttempt
        .getAppAttemptState())
    ._("AM Container:",
        amContainerId == null
            || containers == null
            || !hasAMContainer(appAttemptReport.getAMContainerId(),
                containers) ? null : root_url("container", amContainerId),
        amContainerId == null ? "N/A" : amContainerId)
    ._("Node:", node)
    ._(
      "Tracking URL:",
      appAttempt.getTrackingUrl() == null
          || appAttempt.getTrackingUrl().equals(UNAVAILABLE) ? null
          : root_url(appAttempt.getTrackingUrl()),
      appAttempt.getTrackingUrl() == null
          || appAttempt.getTrackingUrl().equals(UNAVAILABLE)
          ? "Unassigned"
          : appAttempt.getAppAttemptState() == YarnApplicationAttemptState.FINISHED
              || appAttempt.getAppAttemptState() == YarnApplicationAttemptState.FAILED
              || appAttempt.getAppAttemptState() == YarnApplicationAttemptState.KILLED
              ? "History" : "ApplicationMaster")
    ._(
      "Diagnostics Info:",
      appAttempt.getDiagnosticsInfo() == null ? "" : appAttempt
        .getDiagnosticsInfo());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:34,代码来源:AppAttemptBlock.java


示例5: getAppAttempts

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
public AppAttemptsInfo getAppAttempts(HttpServletRequest req,
    HttpServletResponse res, String appId) {
  UserGroupInformation callerUGI = getUser(req);
  final ApplicationId id = parseApplicationId(appId);
  Collection<ApplicationAttemptReport> appAttemptReports = null;
  try {
    if (callerUGI == null) {
      appAttemptReports = appContext.getApplicationAttempts(id).values();
    } else {
      appAttemptReports = callerUGI.doAs(
          new PrivilegedExceptionAction<Collection<ApplicationAttemptReport>> () {
        @Override
        public Collection<ApplicationAttemptReport> run() throws Exception {
          return appContext.getApplicationAttempts(id).values();
        }
      });
    }
  } catch (Exception e) {
    rewrapAndThrowException(e);
  }
  AppAttemptsInfo appAttemptsInfo = new AppAttemptsInfo();
  for (ApplicationAttemptReport appAttemptReport : appAttemptReports) {
    AppAttemptInfo appAttemptInfo = new AppAttemptInfo(appAttemptReport);
    appAttemptsInfo.add(appAttemptInfo);
  }

  return appAttemptsInfo;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:29,代码来源:WebServices.java


示例6: getAppAttempt

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
public AppAttemptInfo getAppAttempt(HttpServletRequest req,
    HttpServletResponse res, String appId, String appAttemptId) {
  UserGroupInformation callerUGI = getUser(req);
  ApplicationId aid = parseApplicationId(appId);
  final ApplicationAttemptId aaid = parseApplicationAttemptId(appAttemptId);
  validateIds(aid, aaid, null);
  ApplicationAttemptReport appAttempt = null;
  try {
    if (callerUGI == null) {
      appAttempt = appContext.getApplicationAttempt(aaid);
    } else {
      appAttempt = callerUGI.doAs(
          new PrivilegedExceptionAction<ApplicationAttemptReport> () {
        @Override
        public ApplicationAttemptReport run() throws Exception {
          return appContext.getApplicationAttempt(aaid);
        }
      });
    }
  } catch (Exception e) {
    rewrapAndThrowException(e);
  }
  if (appAttempt == null) {
    throw new NotFoundException("app attempt with id: " + appAttemptId
        + " not found");
  }
  return new AppAttemptInfo(appAttempt);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:29,代码来源:WebServices.java


示例7: createApplicationAttemptTable

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的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


示例8: generateApplicationTable

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的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


示例9: generateOverview

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
protected void generateOverview(ApplicationAttemptReport appAttemptReport,
    Collection<ContainerReport> containers, AppAttemptInfo appAttempt,
    String node) {

  String blacklistedNodes = "-";
  Set<String> nodes =
      getBlacklistedNodes(rm, getRMAppAttempt().getAppAttemptId());
  if (nodes != null) {
    if (!nodes.isEmpty()) {
      blacklistedNodes = StringUtils.join(nodes, ", ");
    }
  }

  info("Application Attempt Overview")
    ._(
      "Application Attempt State:",
      appAttempt.getAppAttemptState() == null ? UNAVAILABLE : appAttempt
        .getAppAttemptState())
      ._("Started:", Times.format(appAttempt.getStartedTime()))
      ._("Elapsed:",
          org.apache.hadoop.util.StringUtils.formatTime(Times.elapsed(
              appAttempt.getStartedTime(), appAttempt.getFinishedTime())))
    ._(
      "AM Container:",
      appAttempt.getAmContainerId() == null || containers == null
          || !hasAMContainer(appAttemptReport.getAMContainerId(), containers)
          ? null : root_url("container", appAttempt.getAmContainerId()),
      appAttempt.getAmContainerId() == null ? "N/A" :
        String.valueOf(appAttempt.getAmContainerId()))
    ._("Node:", node)
    ._(
      "Tracking URL:",
      appAttempt.getTrackingUrl() == null
          || appAttempt.getTrackingUrl().equals(UNAVAILABLE) ? null
          : root_url(appAttempt.getTrackingUrl()),
      appAttempt.getTrackingUrl() == null
          || appAttempt.getTrackingUrl().equals(UNAVAILABLE)
          ? "Unassigned"
          : appAttempt.getAppAttemptState() == YarnApplicationAttemptState.FINISHED
              || appAttempt.getAppAttemptState() == YarnApplicationAttemptState.FAILED
              || appAttempt.getAppAttemptState() == YarnApplicationAttemptState.KILLED
              ? "History" : "ApplicationMaster")
    ._(
      "Diagnostics Info:",
      appAttempt.getDiagnosticsInfo() == null ? "" : appAttempt
        .getDiagnosticsInfo())._("Blacklisted Nodes:", blacklistedNodes);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:48,代码来源:RMAppAttemptBlock.java


示例10: createApplicationAttemptTable

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的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


示例11: generateOverview

import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; //导入依赖的package包/类
protected void generateOverview(ApplicationAttemptReport appAttemptReport,
    Collection<ContainerReport> containers, AppAttemptInfo appAttempt,
    String node) {

  RMAppAttempt rmAppAttempt = getRMAppAttempt();
  // nodes which are blacklisted by the application
  String appBlacklistedNodes =
      getNodeString(rmAppAttempt.getBlacklistedNodes());
  // nodes which are blacklisted by the RM for AM launches
  String rmBlackListedNodes =
      getNodeString(rmAppAttempt.getAMBlacklistManager()
        .getBlacklistUpdates().getBlacklistAdditions());

  info("Application Attempt Overview")
    ._(
      "Application Attempt State:",
      appAttempt.getAppAttemptState() == null ? UNAVAILABLE : appAttempt
        .getAppAttemptState())
      ._("Started:", Times.format(appAttempt.getStartedTime()))
      ._("Elapsed:",
          org.apache.hadoop.util.StringUtils.formatTime(Times.elapsed(
              appAttempt.getStartedTime(), appAttempt.getFinishedTime())))
    ._(
      "AM Container:",
      appAttempt.getAmContainerId() == null || containers == null
          || !hasAMContainer(appAttemptReport.getAMContainerId(), containers)
          ? null : root_url("container", appAttempt.getAmContainerId()),
      appAttempt.getAmContainerId() == null ? "N/A" :
        String.valueOf(appAttempt.getAmContainerId()))
    ._("Node:", node)
    ._(
      "Tracking URL:",
      appAttempt.getTrackingUrl() == null
          || appAttempt.getTrackingUrl().equals(UNAVAILABLE) ? null
          : root_url(appAttempt.getTrackingUrl()),
      appAttempt.getTrackingUrl() == null
          || appAttempt.getTrackingUrl().equals(UNAVAILABLE)
          ? "Unassigned"
          : appAttempt.getAppAttemptState() == YarnApplicationAttemptState.FINISHED
              || appAttempt.getAppAttemptState() == YarnApplicationAttemptState.FAILED
              || appAttempt.getAppAttemptState() == YarnApplicationAttemptState.KILLED
              ? "History" : "ApplicationMaster")
    ._(
      "Diagnostics Info:",
      appAttempt.getDiagnosticsInfo() == null ? "" : appAttempt
        .getDiagnosticsInfo())
    ._("Nodes blacklisted by the application:", appBlacklistedNodes)
    ._("Nodes blacklisted by the system:", rmBlackListedNodes);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:50,代码来源:RMAppAttemptBlock.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Milestone类代码示例发布时间:2022-05-22
下一篇:
Java Scene类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap