use of org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptImpl in project hadoop by apache.
the class RMAppImpl method recover.
@Override
public void recover(RMState state) {
ApplicationStateData appState = state.getApplicationState().get(getApplicationId());
this.recoveredFinalState = appState.getState();
if (recoveredFinalState == null) {
LOG.info(String.format(RECOVERY_MESSAGE, getApplicationId(), appState.getAttemptCount(), "NONE"));
} else if (LOG.isDebugEnabled()) {
LOG.debug(String.format(RECOVERY_MESSAGE, getApplicationId(), appState.getAttemptCount(), recoveredFinalState));
}
this.diagnostics.append(null == appState.getDiagnostics() ? "" : appState.getDiagnostics());
this.storedFinishTime = appState.getFinishTime();
this.startTime = appState.getStartTime();
this.callerContext = appState.getCallerContext();
this.applicationTimeouts = appState.getApplicationTimeouts();
// If interval > 0, some attempts might have been deleted.
if (this.attemptFailuresValidityInterval > 0) {
this.firstAttemptIdInStateStore = appState.getFirstAttemptId();
this.nextAttemptId = firstAttemptIdInStateStore;
}
//TODO recover collector address.
//this.collectorAddr = appState.getCollectorAddr();
// send the ATS create Event during RM recovery.
// NOTE: it could be duplicated with events sent before RM get restarted.
sendATSCreateEvent();
RMAppAttemptImpl preAttempt = null;
for (ApplicationAttemptId attemptId : new TreeSet<>(appState.attempts.keySet())) {
// create attempt
createNewAttempt(attemptId);
((RMAppAttemptImpl) this.currentAttempt).recover(state);
// about its final state.
if (preAttempt != null && preAttempt.getRecoveredFinalState() == null) {
preAttempt.setRecoveredFinalState(RMAppAttemptState.FAILED);
}
preAttempt = (RMAppAttemptImpl) currentAttempt;
}
if (currentAttempt != null) {
nextAttemptId = currentAttempt.getAppAttemptId().getAttemptId() + 1;
}
}
use of org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptImpl in project hadoop by apache.
the class RMAppImpl method createNewAttempt.
private void createNewAttempt(ApplicationAttemptId appAttemptId) {
BlacklistManager currentAMBlacklistManager;
if (currentAttempt != null) {
// Transfer over the blacklist from the previous app-attempt.
currentAMBlacklistManager = currentAttempt.getAMBlacklistManager();
} else {
if (amBlacklistingEnabled && !submissionContext.getUnmanagedAM()) {
currentAMBlacklistManager = new SimpleBlacklistManager(RMServerUtils.getApplicableNodeCountForAM(rmContext, conf, getAMResourceRequest()), blacklistDisableThreshold);
} else {
currentAMBlacklistManager = new DisabledBlacklistManager();
}
}
RMAppAttempt attempt = new RMAppAttemptImpl(appAttemptId, rmContext, scheduler, masterService, submissionContext, conf, amReq, this, currentAMBlacklistManager);
attempts.put(appAttemptId, attempt);
currentAttempt = attempt;
}
Aggregations