@Test public void testHandleRMHABeforeSubmitApplicationCallWithSavedApplicationState() throws Exception { // start two RMs, and transit rm1 to active, rm2 to standby startRMs(); // get a new applicationId from rm1 ApplicationId appId = rm1.getNewAppId().getApplicationId(); // Do the failover explicitFailover(); // submit the application with previous assigned applicationId // to current active rm: rm2 RMApp app1 = rm2.submitApp(200, "", UserGroupInformation .getCurrentUser().getShortUserName(), null, false, null, configuration.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, false, false, true, appId); // verify application submission verifySubmitApp(rm2, app1, appId); }
@Test public void testHandleRMHABeforeSubmitApplicationCallWithSavedApplicationState() throws Exception { // start two RMs, and transit rm1 to active, rm2 to standby startRMs(); // get a new applicationId from rm1 ApplicationId appId = rm1.getNewAppId().getApplicationId(); // Do the failover explicitFailover(); // submit the application with previous assigned applicationId // to current active rm: rm2 RMApp app1 = rm2.submitApp(200, "", UserGroupInformation .getCurrentUser().getShortUserName(), null, false, null, configuration.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS), null, null, false, false, true, appId); // verify application submission verifySubmitApp(rm2, app1, appId); }
@Test public void testGetNewAppId() throws Exception { Logger rootLogger = LogManager.getRootLogger(); rootLogger.setLevel(Level.DEBUG); MockRM rm = new MockRM(conf); rm.start(); GetNewApplicationResponse resp = rm.getNewAppId(); assert (resp.getApplicationId().getId() != 0); assert (resp.getMaximumResourceCapability().getMemory() > 0); rm.stop(); }
@Test public void testGetNewAppId() throws Exception { Logger rootLogger = LogManager.getRootLogger(); rootLogger.setLevel(Level.DEBUG); MockRM rm = new MockRM(conf); rm.start(); GetNewApplicationResponse resp = rm.getNewAppId(); assert (resp.getApplicationId().getId() != 0); assert (resp.getMaximumResourceCapability().getMemorySize() > 0); rm.stop(); }
private void checkActiveRMFunctionality() throws Exception { assertEquals(STATE_ERR, HAServiceState.ACTIVE, rm.adminService.getServiceStatus().getState()); assertTrue("Active RM services aren't started", rm.areActiveServicesRunning()); assertTrue("RM is not ready to become active", rm.adminService.getServiceStatus().isReadyToBecomeActive()); try { rm.getNewAppId(); rm.registerNode("127.0.0.1:1", 2048); app = rm.submitApp(1024); attempt = app.getCurrentAppAttempt(); rm.waitForState(attempt.getAppAttemptId(), RMAppAttemptState.SCHEDULED); } catch (Exception e) { fail("Unable to perform Active RM functions"); LOG.error("ActiveRM check failed", e); } checkActiveRMWebServices(); }
private void checkActiveRMFunctionality() throws Exception { assertEquals(STATE_ERR, HAServiceState.ACTIVE, rm.adminService.getServiceStatus().getState()); assertTrue("Active RM services aren't started", rm.areActiveServicesRunning()); assertTrue("RM is not ready to become active", rm.adminService.getServiceStatus().isReadyToBecomeActive()); try { rm.getNewAppId(); nm = rm.registerNode("127.0.0.1:1", 2048); app = rm.submitApp(1024); attempt = app.getCurrentAppAttempt(); rm.waitForState(attempt.getAppAttemptId(), RMAppAttemptState.SCHEDULED); } catch (Exception e) { fail("Unable to perform Active RM functions"); LOG.error("ActiveRM check failed", e); } checkActiveRMWebServices(); }