@Public
 @Unstable
 public static GetApplicationAttemptReportResponse newInstance(
     ApplicationAttemptReport ApplicationAttemptReport) {
   GetApplicationAttemptReportResponse response =
       Records.newRecord(GetApplicationAttemptReportResponse.class);
   response.setApplicationAttemptReport(ApplicationAttemptReport);
   return response;
 }
예제 #2
0
 @Override
 public ApplicationAttemptReport getApplicationAttemptReport(ApplicationAttemptId appAttemptId)
     throws YarnException, IOException {
   try {
     GetApplicationAttemptReportRequest request =
         Records.newRecord(GetApplicationAttemptReportRequest.class);
     request.setApplicationAttemptId(appAttemptId);
     GetApplicationAttemptReportResponse response = rmClient.getApplicationAttemptReport(request);
     return response.getApplicationAttemptReport();
   } catch (YarnException e) {
     if (!historyServiceEnabled) {
       // Just throw it as usual if historyService is not enabled.
       throw e;
     }
     // Even if history-service is enabled, treat all exceptions still the same
     // except the following
     if (e.getClass() != ApplicationNotFoundException.class) {
       throw e;
     }
     return historyClient.getApplicationAttemptReport(appAttemptId);
   }
 }
예제 #3
0
 @Override
 public ApplicationAttemptReport getApplicationAttemptReport(ApplicationAttemptId appAttemptId)
     throws YarnException, IOException {
   when(mockAttemptResponse.getApplicationAttemptReport()).thenReturn(getAttempt(appAttemptId));
   return super.getApplicationAttemptReport(appAttemptId);
 }