gpt4 book ai didi

org.apache.hadoop.yarn.client.api.YarnClient.getApplicationAttempts()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 19:02:40 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClient.getApplicationAttempts()方法的一些代码示例,展示了YarnClient.getApplicationAttempts()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClient.getApplicationAttempts()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.client.api.YarnClient
类名称:YarnClient
方法名:getApplicationAttempts

YarnClient.getApplicationAttempts介绍

[英]Get a report of all (ApplicationAttempts) of Application in the cluster.
[中]获取集群中所有(应用程序尝试)应用程序的报告。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-jobclient

@Override
public List<ApplicationAttemptReport> getApplicationAttempts(
  ApplicationId appId) throws YarnException, IOException {
 return client.getApplicationAttempts(appId);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-jobclient

@Override
public List<ApplicationAttemptReport> getApplicationAttempts(
  ApplicationId appId) throws YarnException, IOException {
 return client.getApplicationAttempts(appId);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client

private List<ContainerReport> getContainerReportsFromRunningApplication(
  ContainerLogsRequest options) throws YarnException, IOException {
 List<ContainerReport> reports = new ArrayList<ContainerReport>();
 List<ApplicationAttemptReport> attempts =
   yarnClient.getApplicationAttempts(options.getAppId());
 Map<ContainerId, ContainerReport> containerMap = new TreeMap<
   ContainerId, ContainerReport>();
 for (ApplicationAttemptReport attempt : attempts) {
  List<ContainerReport> containers = yarnClient.getContainers(
    attempt.getApplicationAttemptId());
  for (ContainerReport container : containers) {
   if (!containerMap.containsKey(container.getContainerId())) {
    containerMap.put(container.getContainerId(), container);
   }
  }
 }
 reports.addAll(containerMap.values());
 return reports;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-client

/**
 * Lists the application attempts matching the given applicationid
 * 
 * @param applicationId
 * @throws YarnException
 * @throws IOException
 */
private void listApplicationAttempts(String applicationId) throws YarnException,
  IOException {
 PrintWriter writer = new PrintWriter(
   new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
 List<ApplicationAttemptReport> appAttemptsReport = client
   .getApplicationAttempts(ConverterUtils.toApplicationId(applicationId));
 writer.println("Total number of application attempts " + ":"
   + appAttemptsReport.size());
 writer.printf(APPLICATION_ATTEMPTS_PATTERN, "ApplicationAttempt-Id",
   "State", "AM-Container-Id", "Tracking-URL");
 for (ApplicationAttemptReport appAttemptReport : appAttemptsReport) {
  writer.printf(APPLICATION_ATTEMPTS_PATTERN, appAttemptReport
    .getApplicationAttemptId(), appAttemptReport
    .getYarnApplicationAttemptState(), appAttemptReport
    .getAMContainerId().toString(), appAttemptReport.getTrackingUrl());
 }
 writer.flush();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-client

/**
 * Lists the application attempts matching the given applicationid
 * 
 * @param applicationId
 * @throws YarnException
 * @throws IOException
 */
private void listApplicationAttempts(String applicationId) throws YarnException,
  IOException {
 PrintWriter writer = new PrintWriter(
   new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
 List<ApplicationAttemptReport> appAttemptsReport = client
   .getApplicationAttempts(ConverterUtils.toApplicationId(applicationId));
 writer.println("Total number of application attempts " + ":"
   + appAttemptsReport.size());
 writer.printf(APPLICATION_ATTEMPTS_PATTERN, "ApplicationAttempt-Id",
   "State", "AM-Container-Id", "Tracking-URL");
 for (ApplicationAttemptReport appAttemptReport : appAttemptsReport) {
  writer.printf(APPLICATION_ATTEMPTS_PATTERN, appAttemptReport
    .getApplicationAttemptId(), appAttemptReport
    .getYarnApplicationAttemptState(), appAttemptReport
    .getAMContainerId().toString(), appAttemptReport.getTrackingUrl());
 }
 writer.flush();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client

/**
 * Lists the application attempts matching the given applicationid
 * 
 * @param applicationId
 * @throws YarnException
 * @throws IOException
 */
private void listApplicationAttempts(String applicationId) throws YarnException,
  IOException {
 PrintWriter writer = new PrintWriter(
   new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
 List<ApplicationAttemptReport> appAttemptsReport = client
   .getApplicationAttempts(ApplicationId.fromString(applicationId));
 writer.println("Total number of application attempts " + ":"
   + appAttemptsReport.size());
 writer.printf(APPLICATION_ATTEMPTS_PATTERN, "ApplicationAttempt-Id",
   "State", "AM-Container-Id", "Tracking-URL");
 for (ApplicationAttemptReport appAttemptReport : appAttemptsReport) {
  writer.printf(APPLICATION_ATTEMPTS_PATTERN, appAttemptReport
    .getApplicationAttemptId(), appAttemptReport
    .getYarnApplicationAttemptState(), appAttemptReport
    .getAMContainerId() == null ? "N/A" : appAttemptReport
    .getAMContainerId().toString(), appAttemptReport.getTrackingUrl());
 }
 writer.flush();
}

代码示例来源:origin: io.hops/hadoop-yarn-client

/**
 * Lists the application attempts matching the given applicationid
 * 
 * @param applicationId
 * @throws YarnException
 * @throws IOException
 */
private void listApplicationAttempts(String applicationId) throws YarnException,
  IOException {
 PrintWriter writer = new PrintWriter(
   new OutputStreamWriter(sysout, Charset.forName("UTF-8")));
 List<ApplicationAttemptReport> appAttemptsReport = client
   .getApplicationAttempts(ApplicationId.fromString(applicationId));
 writer.println("Total number of application attempts " + ":"
   + appAttemptsReport.size());
 writer.printf(APPLICATION_ATTEMPTS_PATTERN, "ApplicationAttempt-Id",
   "State", "AM-Container-Id", "Tracking-URL");
 for (ApplicationAttemptReport appAttemptReport : appAttemptsReport) {
  writer.printf(APPLICATION_ATTEMPTS_PATTERN, appAttemptReport
    .getApplicationAttemptId(), appAttemptReport
    .getYarnApplicationAttemptState(), appAttemptReport
    .getAMContainerId() == null ? "N/A" : appAttemptReport
    .getAMContainerId().toString(), appAttemptReport.getTrackingUrl());
 }
 writer.flush();
}

代码示例来源:origin: hopshadoop/hopsworks

YarnClient yarnClient = yarnClientService.getYarnClientSuper(settings.getConfiguration()).getYarnClient();
try {
 List<ApplicationAttemptReport> attempts = yarnClient.getApplicationAttempts(appId);
 ApplicationAttemptReport current = null;
 for (ApplicationAttemptReport attempt : attempts) {

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com