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; }
private ApplicationReport getDefaultApplicationReport(ApplicationId appId) { ApplicationReport result = new ApplicationReportPBImpl(); result.setApplicationId(appId); result.setOriginalTrackingUrl("localhost:" + originalPort + "/foo/bar"); result.setYarnApplicationState(YarnApplicationState.RUNNING); result.setUser(CommonConfigurationKeys.DEFAULT_HADOOP_HTTP_STATIC_USER); return result; }
@Test public void testRunningApp() throws Exception { YarnClient client = createCheckerWithMockedClient(); ApplicationId id = ApplicationId.newInstance(1, 1); // create a report and set the state to an active one ApplicationReport report = new ApplicationReportPBImpl(); report.setYarnApplicationState(YarnApplicationState.ACCEPTED); doReturn(report).when(client).getApplicationReport(id); assertTrue(checker.isApplicationActive(id)); }
private ApplicationReportPBImpl getApplicationReport(long startTime, long finishTime, String name, YarnApplicationState state) { ApplicationReportPBImpl ar = new ApplicationReportPBImpl(); ar.setFinishTime(finishTime); ar.setStartTime(startTime); ar.setApplicationType(name); ar.setYarnApplicationState(state); return ar; }
private ApplicationReportPBImpl convertFromProtoFormat(ApplicationReportProto p) { return new ApplicationReportPBImpl(p); }
private ApplicationReportProto convertToProtoFormat(ApplicationReport t) { return ((ApplicationReportPBImpl)t).getProto(); }
@Test public void testApplicationReportPBImpl() throws Exception { validatePBImplRecord(ApplicationReportPBImpl.class, ApplicationReportProto.class); }