@Override public void transition(RMAppImpl app, RMAppEvent event) { if (app.targetedFinalState.equals(RMAppState.FAILED) || app.targetedFinalState.equals(RMAppState.KILLED)) { // Ignore Attempt_Finished event if we were supposed to reach FAILED // FINISHED state return; } // pass in the earlier attempt_unregistered event, as it is needed in // AppFinishedFinalStateSavedTransition later on app.rememberTargetTransitions(event, new AppFinishedFinalStateSavedTransition(app.eventCausingFinalSaving), RMAppState.FINISHED); }; }
@Override public void transition(RMAppImpl app, RMAppEvent event) { if (app.targetedFinalState.equals(RMAppState.FAILED) || app.targetedFinalState.equals(RMAppState.KILLED)) { // Ignore Attempt_Finished event if we were supposed to reach FAILED // FINISHED state return; } // pass in the earlier attempt_unregistered event, as it is needed in // AppFinishedFinalStateSavedTransition later on app.rememberTargetTransitions(event, new AppFinishedFinalStateSavedTransition(app.eventCausingFinalSaving), RMAppState.FINISHED); }; }
@Override public void transition(RMAppImpl app, RMAppEvent event) { if (app.targetedFinalState.equals(RMAppState.FAILED) || app.targetedFinalState.equals(RMAppState.KILLED)) { // Ignore Attempt_Finished event if we were supposed to reach FAILED // FINISHED state return; } // pass in the earlier attempt_unregistered event, as it is needed in // AppFinishedFinalStateSavedTransition later on app.rememberTargetTransitions(event, new AppFinishedFinalStateSavedTransition(app.eventCausingFinalSaving), RMAppState.FINISHED); }; }
@Override public YarnApplicationState createApplicationState() { RMAppState rmAppState = getState(); // If App is in FINAL_SAVING state, return its previous state. if (rmAppState.equals(RMAppState.FINAL_SAVING)) { rmAppState = stateBeforeFinalSaving; } if (rmAppState.equals(RMAppState.KILLING)) { rmAppState = stateBeforeKilling; } return RMServerUtils.createApplicationState(rmAppState); }
@Override public YarnApplicationState createApplicationState() { RMAppState rmAppState = getState(); // If App is in FINAL_SAVING state, return its previous state. if (rmAppState.equals(RMAppState.FINAL_SAVING)) { rmAppState = stateBeforeFinalSaving; } if (rmAppState.equals(RMAppState.KILLING)) { rmAppState = stateBeforeKilling; } return RMServerUtils.createApplicationState(rmAppState); }
@Override public YarnApplicationState createApplicationState() { RMAppState rmAppState = getState(); // If App is in FINAL_SAVING state, return its previous state. if (rmAppState.equals(RMAppState.FINAL_SAVING)) { rmAppState = stateBeforeFinalSaving; } if (rmAppState.equals(RMAppState.KILLING)) { rmAppState = stateBeforeKilling; } return RMServerUtils.createApplicationState(rmAppState); }
@Inject public FairSchedulerAppsBlock(ResourceManager rm, ViewContext ctx, Configuration conf) { super(ctx); FairScheduler scheduler = (FairScheduler) rm.getResourceScheduler(); fsinfo = new FairSchedulerInfo(scheduler); apps = new ConcurrentHashMap<ApplicationId, RMApp>(); for (Map.Entry<ApplicationId, RMApp> entry : rm.getRMContext().getRMApps() .entrySet()) { if (!(RMAppState.NEW.equals(entry.getValue().getState()) || RMAppState.NEW_SAVING.equals(entry.getValue().getState()) || RMAppState.SUBMITTED.equals(entry.getValue().getState()))) { apps.put(entry.getKey(), entry.getValue()); } } this.conf = conf; this.rm = rm; }
@Inject public FairSchedulerAppsBlock(ResourceManager rm, ViewContext ctx, Configuration conf) { super(ctx); FairScheduler scheduler = (FairScheduler) rm.getResourceScheduler(); fsinfo = new FairSchedulerInfo(scheduler); apps = new ConcurrentHashMap<ApplicationId, RMApp>(); for (Map.Entry<ApplicationId, RMApp> entry : rm.getRMContext().getRMApps() .entrySet()) { if (!(RMAppState.NEW.equals(entry.getValue().getState()) || RMAppState.NEW_SAVING.equals(entry.getValue().getState()) || RMAppState.SUBMITTED.equals(entry.getValue().getState()))) { apps.put(entry.getKey(), entry.getValue()); } } this.conf = conf; this.rm = rm; }
@Inject public FairSchedulerAppsBlock(ResourceManager rm, ViewContext ctx, Configuration conf) { super(ctx); FairScheduler scheduler = (FairScheduler) rm.getResourceScheduler(); fsinfo = new FairSchedulerInfo(scheduler); apps = new ConcurrentHashMap<ApplicationId, RMApp>(); for (Map.Entry<ApplicationId, RMApp> entry : rm.getRMContext().getRMApps() .entrySet()) { if (!(RMAppState.NEW.equals(entry.getValue().getState()) || RMAppState.NEW_SAVING.equals(entry.getValue().getState()) || RMAppState.SUBMITTED.equals(entry.getValue().getState()))) { apps.put(entry.getKey(), entry.getValue()); } } this.conf = conf; this.rm = rm; }
if (!app.submissionContext.getUnmanagedAM() && numberOfFailure < app.maxAppAttempts) { if (initialState.equals(RMAppState.KILLING)) {
if (!app.submissionContext.getUnmanagedAM() && numberOfFailure < app.maxAppAttempts) { if (initialState.equals(RMAppState.KILLING)) {
if (initialState.equals(RMAppState.KILLING)) {
public void waitForState(ApplicationId appId, RMAppState finalState) throws Exception { RMApp app = getRMContext().getRMApps().get(appId); Assert.assertNotNull("app shouldn't be null", app); int timeoutSecs = 0; while (!finalState.equals(app.getState()) && timeoutSecs++ < 40) { System.out.println("App : " + appId + " State is : " + app.getState() + " Waiting for state : " + finalState); Thread.sleep(2000); } System.out.println("App State is : " + app.getState()); Assert.assertEquals("App state is not correct (timedout)", finalState, app.getState()); }
/** * Wait until an application has reached a specified state. * The timeout is 80 seconds. * @param appId the id of an application * @param finalState the application state waited * @throws InterruptedException * if interrupted while waiting for the state transition */ public void waitForState(ApplicationId appId, RMAppState finalState) throws InterruptedException { drainEventsImplicitly(); RMApp app = getRMContext().getRMApps().get(appId); Assert.assertNotNull("app shouldn't be null", app); final int timeoutMsecs = 80 * SECOND; int timeWaiting = 0; while (!finalState.equals(app.getState())) { if (timeWaiting >= timeoutMsecs) { break; } LOG.info("App : " + appId + " State is : " + app.getState() + " Waiting for state : " + finalState); Thread.sleep(WAIT_MS_PER_LOOP); timeWaiting += WAIT_MS_PER_LOOP; } LOG.info("App State is : " + app.getState()); Assert.assertEquals("App State is not correct (timeout).", finalState, app.getState()); }
while (!application.getState().equals(RMAppState.SUBMITTED) && numTries < MAX_TRIES) { try {