@Override public List<ApplicationAttemptReport> getApplicationAttempts( ApplicationId appId) throws YarnException, IOException { return client.getApplicationAttempts(appId); }
@Override public List<ApplicationAttemptReport> getApplicationAttempts( ApplicationId appId) throws YarnException, IOException { return client.getApplicationAttempts(appId); }
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; }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
YarnClient yarnClient = yarnClientService.getYarnClientSuper(settings.getConfiguration()).getYarnClient(); try { List<ApplicationAttemptReport> attempts = yarnClient.getApplicationAttempts(appId); ApplicationAttemptReport current = null; for (ApplicationAttemptReport attempt : attempts) {