this.recoveredState = TaskState.RUNNING;
return recoveredState;
}
case TASK_ATTEMPT_FINISHED:
{
TaskAttemptFinishedEvent taskAttemptFinishedEvent =
(TaskAttemptFinishedEvent) historyEvent;
TaskAttempt taskAttempt = this.attempts.get(
taskAttemptFinishedEvent.getTaskAttemptID());
finishedAttempts++;
if (taskAttempt == null) {
LOG.warn("Received an attempt finished event for an attempt that "
+ " never started or does not exist"
+ ", taskAttemptId=" + taskAttemptFinishedEvent.getTaskAttemptID()
+ ", taskAttemptFinishState=" + taskAttemptFinishedEvent.getState());
TaskAttempt recoveredAttempt = createRecoveredEvent(
taskAttemptFinishedEvent.getTaskAttemptID());
this.attempts.put(taskAttemptFinishedEvent.getTaskAttemptID(),
recoveredAttempt);
if (!taskAttemptFinishedEvent.getState().equals(TaskAttemptState.KILLED)) {
throw new TezUncheckedException("Could not find task attempt"
+ " when trying to recover"
+ ", taskAttemptId=" + taskAttemptFinishedEvent.getTaskAttemptID()
+ ", taskAttemptFinishState" + taskAttemptFinishedEvent.getState());
}
return recoveredState;
}
--numberUncompletedAttempts;
if (numberUncompletedAttempts < 0) {