private void runApplicationAttempt(Container container, String host, int rpcPort, String trackingUrl, boolean unmanagedAM) { applicationAttempt.handle( new RMAppAttemptRegistrationEvent( applicationAttempt.getAppAttemptId(), host, rpcPort, trackingUrl)); testAppAttemptRunningState(container, host, rpcPort, trackingUrl, unmanagedAM); }
private void runApplicationAttempt(Container container, String host, int rpcPort, String trackingUrl, boolean unmanagedAM) { applicationAttempt.handle( new RMAppAttemptRegistrationEvent( applicationAttempt.getAppAttemptId(), host, rpcPort, trackingUrl)); testAppAttemptRunningState(container, host, rpcPort, trackingUrl, unmanagedAM); }
@Test public void testUnmanagedAMContainersCleanup() { unmanagedAM = true; when(submissionContext.getUnmanagedAM()).thenReturn(true); when(submissionContext.getKeepContainersAcrossApplicationAttempts()) .thenReturn(true); // submit AM and check it goes to SUBMITTED state submitApplicationAttempt(); // launch AM and verify attempt failed applicationAttempt.handle(new RMAppAttemptRegistrationEvent( applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl")); assertEquals(YarnApplicationAttemptState.SUBMITTED, applicationAttempt.createApplicationAttemptState()); sendAttemptUpdateSavedEvent(applicationAttempt); assertFalse(transferStateFromPreviousAttempt); }
@Test public void testUnmanagedAMContainersCleanup() { unmanagedAM = true; when(submissionContext.getUnmanagedAM()).thenReturn(true); when(submissionContext.getKeepContainersAcrossApplicationAttempts()) .thenReturn(true); // submit AM and check it goes to SUBMITTED state submitApplicationAttempt(); // launch AM and verify attempt failed applicationAttempt.handle(new RMAppAttemptRegistrationEvent( applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl")); assertEquals(YarnApplicationAttemptState.SUBMITTED, applicationAttempt.createApplicationAttemptState()); sendAttemptUpdateSavedEvent(applicationAttempt); assertFalse(transferStateFromPreviousAttempt); }
@Test public void testUnmanagedAMUnexpectedRegistration() { unmanagedAM = true; when(submissionContext.getUnmanagedAM()).thenReturn(true); // submit AM and check it goes to SUBMITTED state submitApplicationAttempt(); assertEquals(RMAppAttemptState.SUBMITTED, applicationAttempt.getAppAttemptState()); // launch AM and verify attempt failed applicationAttempt.handle(new RMAppAttemptRegistrationEvent( applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl")); assertEquals(YarnApplicationAttemptState.SUBMITTED, applicationAttempt.createApplicationAttemptState()); testAppAttemptSubmittedToFailedState( "Unmanaged AM must register after AM attempt reaches LAUNCHED state."); }
@Test public void testUnmanagedAMUnexpectedRegistration() { unmanagedAM = true; when(submissionContext.getUnmanagedAM()).thenReturn(true); // submit AM and check it goes to SUBMITTED state submitApplicationAttempt(); assertEquals(RMAppAttemptState.SUBMITTED, applicationAttempt.getAppAttemptState()); // launch AM and verify attempt failed applicationAttempt.handle(new RMAppAttemptRegistrationEvent( applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl")); assertEquals(YarnApplicationAttemptState.SUBMITTED, applicationAttempt.createApplicationAttemptState()); testAppAttemptSubmittedToFailedState( "Unmanaged AM must register after AM attempt reaches LAUNCHED state."); }
.getEventHandler() .handle( new RMAppAttemptRegistrationEvent(applicationAttemptId, request .getHost(), request.getRpcPort(), request.getTrackingUrl())); RMAuditLogger.logSuccess(app.getUser(), AuditConstants.REGISTER_AM,
.getEventHandler() .handle( new RMAppAttemptRegistrationEvent(applicationAttemptId, request .getHost(), request.getRpcPort(), request.getTrackingUrl())); RMAuditLogger.logSuccess(app.getUser(), AuditConstants.REGISTER_AM,
getRmContext().getDispatcher().getEventHandler() .handle( new RMAppAttemptRegistrationEvent(applicationAttemptId, request .getHost(), request.getRpcPort(), request.getTrackingUrl())); RMAuditLogger.logSuccess(app.getUser(),