.handle(new RMAppKillByClientEvent(applicationId, message.toString(), callerUGI, remoteAddress));
/** * Log the audit event for kill by client. * @param event The {@link RMAppEvent} to be logged */ static void auditLogKillEvent(RMAppEvent event) { if (event instanceof RMAppKillByClientEvent) { RMAppKillByClientEvent killEvent = (RMAppKillByClientEvent) event; UserGroupInformation callerUGI = killEvent.getCallerUGI(); String userName = null; if (callerUGI != null) { userName = callerUGI.getShortUserName(); } InetAddress remoteIP = killEvent.getIp(); RMAuditLogger.logSuccess(userName, AuditConstants.KILL_APP_REQUEST, "RMAppImpl", event.getApplicationId(), remoteIP); } }
.handle(new RMAppKillByClientEvent(applicationId, message, callerUGI, remoteAddress));
/** * Log the audit event for kill by client. * * @param event * The {@link RMAppEvent} to be logged */ static void auditLogKillEvent(RMAppEvent event) { if (event instanceof RMAppKillByClientEvent) { RMAppKillByClientEvent killEvent = (RMAppKillByClientEvent) event; UserGroupInformation callerUGI = killEvent.getCallerUGI(); String userName = null; if (callerUGI != null) { userName = callerUGI.getShortUserName(); } InetAddress remoteIP = killEvent.getIp(); RMAuditLogger.logSuccess(userName, AuditConstants.KILL_APP_REQUEST, "RMAppImpl", event.getApplicationId(), remoteIP); } }
@Test (timeout = 30000) public void testAppNewSavingKill() throws IOException { LOG.info("--- START: testAppNewSavingKill ---"); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppNewSavingKill", new String[] { "foo_group" }); RMApp application = testCreateAppNewSaving(null); // NEW_SAVING => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAppUpdateSavedEvent(application); assertKilled(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); }
@Test (timeout = 30000) public void testAppNewSavingKill() throws IOException { LOG.info("--- START: testAppNewSavingKill ---"); RMApp application = testCreateAppNewSaving(null); // NEW_SAVING => KILLED event RMAppEventType.KILL UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppNewSavingKill", new String[] {"foo_group"}); RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAppUpdateSavedEvent(application); assertKilled(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); verifyRMAppFieldsForFinalTransitions(application); }
@Test (timeout = 30000) public void testAppNewKill() throws IOException { LOG.info("--- START: testAppNewKill ---"); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppNewKill", new String[] { "foo_group" }); RMApp application = createNewTestApp(null); // NEW => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAppUpdateSavedEvent(application); assertKilled(application); assertAppFinalStateNotSaved(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); }
@Test public void testAppSubmittedKill() throws IOException, InterruptedException { LOG.info("--- START: testAppSubmittedKill---"); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppSubmittedKill", new String[] { "foo_group" }); RMApp application = testCreateAppSubmittedNoRecovery(null); // SUBMITTED => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAppUpdateSavedEvent(application); assertKilled(application); assertAppFinalStateSaved(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); }
@Test public void testAppRunningKill() throws IOException { LOG.info("--- START: testAppRunningKill ---"); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppRunningKill", new String[] { "foo_group" }); RMApp application = testCreateAppRunning(null); // RUNNING => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAttemptUpdateSavedEvent(application); sendAppUpdateSavedEvent(application); assertKilled(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); }
@Test public void testAppSubmittedKill() throws IOException, InterruptedException { LOG.info("--- START: testAppSubmittedKill---"); RMApp application = testCreateAppSubmittedNoRecovery(null); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppSubmittedKill", new String[] {"foo_group"}); // SUBMITTED => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAppUpdateSavedEvent(application); assertKilled(application); assertAppFinalStateSaved(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); verifyRMAppFieldsForFinalTransitions(application); }
@Test public void testAppRunningKill() throws IOException { LOG.info("--- START: testAppRunningKill ---"); RMApp application = testCreateAppRunning(null); // RUNNING => KILLED event RMAppEventType.KILL UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppRunningKill", new String[] {"foo_group"}); // SUBMITTED => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAttemptUpdateSavedEvent(application); sendAppUpdateSavedEvent(application); assertKilled(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); verifyRMAppFieldsForFinalTransitions(application); }
@Test (timeout = 30000) public void testAppNewKill() throws IOException { LOG.info("--- START: testAppNewKill ---"); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppNewKill", new String[] {"foo_group"}); RMApp application = createNewTestApp(null); // NEW => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); sendAppUpdateSavedEvent(application); assertKilled(application); assertAppFinalStateNotSaved(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); verifyRMAppFieldsForFinalTransitions(application); }
RMAppEvent event = new RMAppKillByClientEvent( applicationId, "Application killed by user.", fooUser, Server.getRemoteIp());
@Test public void testAppAcceptedKill() throws IOException, InterruptedException { LOG.info("--- START: testAppAcceptedKill ---"); UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppAcceptedKill", new String[] { "foo_group" }); RMApp application = testCreateAppAccepted(null); // ACCEPTED => KILLED event RMAppEventType.KILL RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); assertAppState(RMAppState.KILLING, application); RMAppEvent appAttemptKilled = new RMAppEvent(application.getApplicationId(), RMAppEventType.ATTEMPT_KILLED, "Application killed by user."); application.handle(appAttemptKilled); assertAppState(RMAppState.FINAL_SAVING, application); sendAppUpdateSavedEvent(application); assertKilled(application); assertAppFinalStateSaved(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); }
@Test public void testAppAcceptedKill() throws IOException, InterruptedException { LOG.info("--- START: testAppAcceptedKill ---"); RMApp application = testCreateAppAccepted(null); // ACCEPTED => KILLED event RMAppEventType.KILL UserGroupInformation fooUser = UserGroupInformation.createUserForTesting( "fooTestAppAcceptedKill", new String[] {"foo_group"}); RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp()); application.handle(event); rmDispatcher.await(); assertAppState(RMAppState.KILLING, application); RMAppEvent appAttemptKilled = new RMAppEvent(application.getApplicationId(), RMAppEventType.ATTEMPT_KILLED, "Application killed by user."); application.handle(appAttemptKilled); assertAppState(RMAppState.FINAL_SAVING, application); sendAppUpdateSavedEvent(application); assertKilled(application); assertAppFinalStateSaved(application); verifyApplicationFinished(RMAppState.KILLED); verifyAppRemovedSchedulerEvent(RMAppState.KILLED); verifyRMAppFieldsForFinalTransitions(application); }
RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp());
RMAppEvent event = new RMAppKillByClientEvent( application.getApplicationId(), "Application killed by user.", fooUser, Server.getRemoteIp());