use of org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportResponse in project hadoop by apache.
the class TestApplicationHistoryClientService method testApplicationAttemptNotFound.
@Test
public void testApplicationAttemptNotFound() throws IOException, YarnException {
ApplicationId appId = ApplicationId.newInstance(0, 1);
ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, MAX_APPS + 1);
GetApplicationAttemptReportRequest request = GetApplicationAttemptReportRequest.newInstance(appAttemptId);
try {
@SuppressWarnings("unused") GetApplicationAttemptReportResponse response = clientService.getApplicationAttemptReport(request);
Assert.fail("Exception should have been thrown before we reach here.");
} catch (ApplicationAttemptNotFoundException e) {
//This Exception is expected
System.out.println(e.getMessage());
Assert.assertTrue(e.getMessage().contains("doesn't exist in the timeline store"));
} catch (Exception e) {
Assert.fail("Undesired exception caught");
}
}
use of org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportResponse in project hadoop by apache.
the class MockResourceManagerFacade method getApplicationAttemptReport.
@Override
public GetApplicationAttemptReportResponse getApplicationAttemptReport(GetApplicationAttemptReportRequest request) throws YarnException, IOException {
GetApplicationAttemptReportResponse response = Records.newRecord(GetApplicationAttemptReportResponse.class);
ApplicationAttemptReport report = Records.newRecord(ApplicationAttemptReport.class);
report.setApplicationAttemptId(request.getApplicationAttemptId());
report.setYarnApplicationAttemptState(YarnApplicationAttemptState.LAUNCHED);
response.setApplicationAttemptReport(report);
return response;
}
Aggregations