@SuppressWarnings("unchecked") @Override public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { // unregister it to TaskAttemptListener so that it stops listening // for it. finalizeProgress(taskAttempt); sendContainerCleanup(taskAttempt, event); // Store reschedule flag so that after clean up is completed, new // attempt is scheduled/rescheduled based on it. if (event instanceof TaskAttemptKillEvent) { taskAttempt.setRescheduleNextAttempt( ((TaskAttemptKillEvent)event).getRescheduleAttempt()); } } }
@SuppressWarnings("unchecked") @Override public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { // unregister it to TaskAttemptListener so that it stops listening // for it taskAttempt.taskAttemptListener.unregister( taskAttempt.attemptId, taskAttempt.jvmID); sendContainerCleanup(taskAttempt, event); // Store reschedule flag so that after clean up is completed, new // attempt is scheduled/rescheduled based on it. if (event instanceof TaskAttemptKillEvent) { taskAttempt.setRescheduleNextAttempt( ((TaskAttemptKillEvent)event).getRescheduleAttempt()); } } }
@SuppressWarnings("unchecked") @Override public void transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { // unregister it to TaskAttemptListener so that it stops listening // for it. finalizeProgress(taskAttempt); sendContainerCleanup(taskAttempt, event); // Store reschedule flag so that after clean up is completed, new // attempt is scheduled/rescheduled based on it. if (event instanceof TaskAttemptKillEvent) { taskAttempt.setRescheduleNextAttempt( ((TaskAttemptKillEvent)event).getRescheduleAttempt()); } else if (event instanceof TaskAttemptFailEvent) { taskAttempt.setTaskFailFast(((TaskAttemptFailEvent)event).isFastFail()); } } }
@SuppressWarnings("unchecked") @Override public TaskAttemptStateInternal transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { taskAttempt.appContext.getTaskAttemptFinishingMonitor().unregister( taskAttempt.attemptId); sendContainerCleanup(taskAttempt, event); if(taskAttempt.getID().getTaskId().getTaskType() == TaskType.REDUCE) { // after a reduce task has succeeded, its outputs are in safe in HDFS. // logically such a task should not be killed. we only come here when // there is a race condition in the event queue. E.g. some logic sends // a kill request to this attempt when the successful completion event // for this task is already in the event queue. so the kill event will // get executed immediately after the attempt is marked successful and // result in this transition being exercised. // ignore this for reduce tasks LOG.info("Ignoring killed event for successful reduce task attempt" + taskAttempt.getID().toString()); return TaskAttemptStateInternal.SUCCESS_CONTAINER_CLEANUP; } else { // Store reschedule flag so that after clean up is completed, new // attempt is scheduled/rescheduled based on it. if (event instanceof TaskAttemptKillEvent) { taskAttempt.setRescheduleNextAttempt( ((TaskAttemptKillEvent)event).getRescheduleAttempt()); } return TaskAttemptStateInternal.KILL_CONTAINER_CLEANUP; } } }
@SuppressWarnings("unchecked") @Override public TaskAttemptStateInternal transition(TaskAttemptImpl taskAttempt, TaskAttemptEvent event) { taskAttempt.appContext.getTaskAttemptFinishingMonitor().unregister( taskAttempt.attemptId); sendContainerCleanup(taskAttempt, event); if(taskAttempt.getID().getTaskId().getTaskType() == TaskType.REDUCE) { // after a reduce task has succeeded, its outputs are in safe in HDFS. // logically such a task should not be killed. we only come here when // there is a race condition in the event queue. E.g. some logic sends // a kill request to this attempt when the successful completion event // for this task is already in the event queue. so the kill event will // get executed immediately after the attempt is marked successful and // result in this transition being exercised. // ignore this for reduce tasks LOG.info("Ignoring killed event for successful reduce task attempt" + taskAttempt.getID().toString()); return TaskAttemptStateInternal.SUCCESS_CONTAINER_CLEANUP; } else { // Store reschedule flag so that after clean up is completed, new // attempt is scheduled/rescheduled based on it. if (event instanceof TaskAttemptKillEvent) { taskAttempt.setRescheduleNextAttempt( ((TaskAttemptKillEvent)event).getRescheduleAttempt()); } return TaskAttemptStateInternal.KILL_CONTAINER_CLEANUP; } } }
if (event instanceof TaskAttemptKillEvent) { rescheduleNextTaskAttempt = ((TaskAttemptKillEvent)event).getRescheduleAttempt();
if (event instanceof TaskAttemptKillEvent) { rescheduleNextTaskAttempt = ((TaskAttemptKillEvent)event).getRescheduleAttempt();
if (event instanceof TaskAttemptKillEvent) { rescheduleNextTaskAttempt = ((TaskAttemptKillEvent)event).getRescheduleAttempt();