appAttempt.masterService.unregisterAttempt(appAttemptId);
appAttempt.masterService.unregisterAttempt(appAttemptId);
appAttempt.masterService.unregisterAttempt(appAttemptId);
/** * {@link RMAppAttemptState#SUBMITTED} -> {@link RMAppAttemptState#FAILED} */ private void testAppAttemptSubmittedToFailedState(String diagnostics) { sendAttemptUpdateSavedEvent(applicationAttempt); assertEquals(RMAppAttemptState.FAILED, applicationAttempt.getAppAttemptState()); assertEquals(diagnostics, applicationAttempt.getDiagnostics()); assertEquals(0,applicationAttempt.getJustFinishedContainers().size()); assertNull(applicationAttempt.getMasterContainer()); assertEquals(0.0, (double)applicationAttempt.getProgress(), 0.0001); assertEquals(0, application.getRanNodes().size()); assertNull(applicationAttempt.getFinalApplicationStatus()); // Check events verify(masterService). unregisterAttempt(applicationAttempt.getAppAttemptId()); // ATTEMPT_FAILED should be notified to app if app attempt is submitted to // failed state. ArgumentMatcher<RMAppEvent> matcher = new ArgumentMatcher<RMAppEvent>() { @Override public boolean matches(Object o) { RMAppEvent event = (RMAppEvent) o; return event.getType() == RMAppEventType.ATTEMPT_FAILED; } }; verify(application).handle(argThat(matcher)); verifyTokenCount(applicationAttempt.getAppAttemptId(), 1); verifyApplicationAttemptFinished(RMAppAttemptState.FAILED); }
/** * {@link RMAppAttemptState#SUBMITTED} -> {@link RMAppAttemptState#FAILED} */ private void testAppAttemptSubmittedToFailedState(String diagnostics) { sendAttemptUpdateSavedEvent(applicationAttempt); assertEquals(RMAppAttemptState.FAILED, applicationAttempt.getAppAttemptState()); assertEquals(diagnostics, applicationAttempt.getDiagnostics()); assertEquals(0,applicationAttempt.getJustFinishedContainers().size()); assertNull(applicationAttempt.getMasterContainer()); assertEquals(0.0, (double)applicationAttempt.getProgress(), 0.0001); assertEquals(0, application.getRanNodes().size()); assertNull(applicationAttempt.getFinalApplicationStatus()); // Check events verify(masterService). unregisterAttempt(applicationAttempt.getAppAttemptId()); // ATTEMPT_FAILED should be notified to app if app attempt is submitted to // failed state. ArgumentMatcher<RMAppEvent> matcher = new ArgumentMatcher<RMAppEvent>() { @Override public boolean matches(Object o) { RMAppEvent event = (RMAppEvent) o; return event.getType() == RMAppEventType.ATTEMPT_FAILED; } }; verify(application).handle(argThat(matcher)); verifyTokenCount(applicationAttempt.getAppAttemptId(), 1); verifyApplicationAttemptFinished(RMAppAttemptState.FAILED); }