fetchedAppReport = getApplicationReport(id); if (fetchedAppReport != null) { if (fetchedAppReport.getAppReportSource() != AppReportSource.RM && fetchedAppReport.getAppReportSource() != AppReportSource.AHS) { throw new UnsupportedOperationException("Application report not " + "fetched from RM or history server."); applicationReport = fetchedAppReport.getApplicationReport(); URI trackingUri; if (original == null || original.equals("N/A") || original.equals("")) { if (fetchedAppReport.getAppReportSource() == AppReportSource.RM) { ProxyUtils.sendRedirect(req, resp, StringHelper.pjoin(rmAppPageUrlBase, id.toString())); } else if (fetchedAppReport.getAppReportSource() == AppReportSource.AHS) {
fetchedAppReport = getApplicationReport(id); if (fetchedAppReport != null) { if (fetchedAppReport.getAppReportSource() != AppReportSource.RM && fetchedAppReport.getAppReportSource() != AppReportSource.AHS) { throw new UnsupportedOperationException("Application report not " + "fetched from RM or history server."); applicationReport = fetchedAppReport.getApplicationReport(); URI trackingUri; if (original == null || original.equals("N/A") || original.equals("")) { if (fetchedAppReport.getAppReportSource() == AppReportSource.RM) { ProxyUtils.sendRedirect(req, resp, StringHelper.pjoin(rmAppPageUrlBase, id.toString())); } else if (fetchedAppReport.getAppReportSource() == AppReportSource.AHS) {
fetchedAppReport = getApplicationReport(id); if (fetchedAppReport != null) { if (fetchedAppReport.getAppReportSource() != AppReportSource.RM && fetchedAppReport.getAppReportSource() != AppReportSource.AHS) { throw new UnsupportedOperationException("Application report not " + "fetched from RM or history server."); applicationReport = fetchedAppReport.getApplicationReport(); URI trackingUri; if (original == null || original.equals("N/A") || original.equals("")) { if (fetchedAppReport.getAppReportSource() == AppReportSource.RM) { ProxyUtils.sendRedirect(req, resp, StringHelper.pjoin(rmAppPageUrlBase, id.toString())); } else if (fetchedAppReport.getAppReportSource() == AppReportSource.AHS) {
applicationReport = fetchedAppReport.getApplicationReport(); fetchedAppReport.getAppReportSource());
} else if (answer == 2) { FetchedAppReport result = getDefaultApplicationReport(appId); result.getApplicationReport().setUser("user"); return result; } else if (answer == 3) { FetchedAppReport result = getDefaultApplicationReport(appId); result.getApplicationReport(). setYarnApplicationState(YarnApplicationState.KILLED); return result; result.getApplicationReport().setOriginalTrackingUrl("localhost:" + originalPort + "/foo/bar?a=b#main"); result.getApplicationReport(). setYarnApplicationState(YarnApplicationState.FINISHED); return result;
appReport = applicationsManager. getApplicationReport(request).getApplicationReport(); fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.RM); } catch (ApplicationNotFoundException e) { if (!isAHSEnabled) { fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.AHS);
} else if (answer == 2) { FetchedAppReport result = getDefaultApplicationReport(appId); result.getApplicationReport().setUser("user"); return result; } else if (answer == 3) { FetchedAppReport result = getDefaultApplicationReport(appId); result.getApplicationReport(). setYarnApplicationState(YarnApplicationState.KILLED); return result; result.getApplicationReport().setOriginalTrackingUrl("localhost:" + originalPort + "/foo/bar?a=b#main"); result.getApplicationReport(). setYarnApplicationState(YarnApplicationState.FINISHED); return result;
appReport = applicationsManager. getApplicationReport(request).getApplicationReport(); fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.RM); } catch (ApplicationNotFoundException e) { if (!isAHSEnabled) { fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.AHS);
appReport = applicationsManager. getApplicationReport(request).getApplicationReport(); fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.RM); } catch (ApplicationNotFoundException e) { if (!isAHSEnabled) { fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.AHS);
appReport = applicationsManager. getApplicationReport(request).getApplicationReport(); fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.RM); } catch (ApplicationNotFoundException e) { if (!isAHSEnabled) { fetchedAppReport = new FetchedAppReport(appReport, AppReportSource.AHS);
private FetchedAppReport getDefaultApplicationReport(ApplicationId appId, boolean isTrackingUrl) { FetchedAppReport fetchedReport; ApplicationReport result = new ApplicationReportPBImpl(); result.setApplicationId(appId); result.setYarnApplicationState(YarnApplicationState.RUNNING); result.setUser(CommonConfigurationKeys.DEFAULT_HADOOP_HTTP_STATIC_USER); if (isTrackingUrl) { result.setOriginalTrackingUrl("localhost:" + originalPort + "/foo/bar"); } if(configuration.getBoolean(YarnConfiguration. APPLICATION_HISTORY_ENABLED, false)) { fetchedReport = new FetchedAppReport(result, AppReportSource.AHS); } else { fetchedReport = new FetchedAppReport(result, AppReportSource.RM); } return fetchedReport; }
/** * Fetch the application report from the RM. * * @param id the app ID * @return the application report * @throws IOException if the request to the RM fails * @throws YarnException if the request to the RM fails */ private FetchedAppReport getFetchedAppReport(ApplicationId id) throws IOException, YarnException { FetchedAppReport fetchedAppReport = getApplicationReport(id); if (fetchedAppReport != null) { if ((fetchedAppReport.getAppReportSource() != AppReportSource.RM) && (fetchedAppReport.getAppReportSource() != AppReportSource.AHS)) { throw new UnsupportedOperationException("Application report not " + "fetched from RM or history server."); } } return fetchedAppReport; }
private FetchedAppReport getDefaultApplicationReport(ApplicationId appId, boolean isTrackingUrl) { FetchedAppReport fetchedReport; ApplicationReport result = new ApplicationReportPBImpl(); result.setApplicationId(appId); result.setYarnApplicationState(YarnApplicationState.RUNNING); result.setUser(CommonConfigurationKeys.DEFAULT_HADOOP_HTTP_STATIC_USER); if (isTrackingUrl) { result.setOriginalTrackingUrl("localhost:" + originalPort + "/foo/bar"); } if(configuration.getBoolean(YarnConfiguration. APPLICATION_HISTORY_ENABLED, false)) { fetchedReport = new FetchedAppReport(result, AppReportSource.AHS); } else { fetchedReport = new FetchedAppReport(result, AppReportSource.RM); } return fetchedReport; }