@Override public void recover(RMState state) throws Exception { // recover RMdelegationTokenSecretManager rmContext.getRMDelegationTokenSecretManager().recover(state); // recover AMRMTokenSecretManager rmContext.getAMRMTokenSecretManager().recover(state); // recover applications rmAppManager.recover(state); setSchedulerRecoveryStartAndWaitTime(state, conf); }
@Override public void recover(RMState state) throws Exception { // recover RMdelegationTokenSecretManager rmContext.getRMDelegationTokenSecretManager().recover(state); // recover AMRMTokenSecretManager rmContext.getAMRMTokenSecretManager().recover(state); // recover applications rmAppManager.recover(state); setSchedulerRecoveryStartAndWaitTime(state, conf); }
@Override public void recover(RMState state) throws Exception { // recover RMdelegationTokenSecretManager rmContext.getRMDelegationTokenSecretManager().recover(state); // recover AMRMTokenSecretManager rmContext.getAMRMTokenSecretManager().recover(state); // recover reservations if (reservationSystem != null) { reservationSystem.recover(state); } // recover applications rmAppManager.recover(state); setSchedulerRecoveryStartAndWaitTime(state, conf); }
public MockAM sendAMLaunched(ApplicationAttemptId appAttemptId) throws Exception { MockAM am = new MockAM(getRMContext(), masterService, appAttemptId); am.waitForState(RMAppAttemptState.ALLOCATED); //create and set AMRMToken Token<AMRMTokenIdentifier> amrmToken = this.rmContext.getAMRMTokenSecretManager().createAndGetAMRMToken( appAttemptId); ((RMAppAttemptImpl) this.rmContext.getRMApps() .get(appAttemptId.getApplicationId()).getRMAppAttempt(appAttemptId)) .setAMRMToken(amrmToken); getRMContext() .getDispatcher() .getEventHandler() .handle( new RMAppAttemptEvent(appAttemptId, RMAppAttemptEventType.LAUNCHED)); return am; }
/** * recommend to use launchAM, or use sendAMLaunched like: * 1, wait RMAppAttempt scheduled * 2, send node heartbeat * 3, sendAMLaunched */ public MockAM sendAMLaunched(ApplicationAttemptId appAttemptId) throws Exception { MockAM am = new MockAM(getRMContext(), masterService, appAttemptId); ((AbstractYarnScheduler)scheduler).update(); waitForState(appAttemptId, RMAppAttemptState.ALLOCATED); //create and set AMRMToken Token<AMRMTokenIdentifier> amrmToken = this.rmContext.getAMRMTokenSecretManager().createAndGetAMRMToken( appAttemptId); ((RMAppAttemptImpl) this.rmContext.getRMApps() .get(appAttemptId.getApplicationId()).getRMAppAttempt(appAttemptId)) .setAMRMToken(amrmToken); getRMContext() .getDispatcher() .getEventHandler() .handle( new RMAppAttemptEvent(appAttemptId, RMAppAttemptEventType.LAUNCHED)); drainEventsImplicitly(); return am; }