Search in sources :

Example 1 with TaskEventType

use of org.apache.hadoop.mapreduce.v2.app.job.event.TaskEventType in project hadoop by apache.

the class TaskImpl method internalError.

protected void internalError(TaskEventType type) {
    LOG.error("Invalid event " + type + " on Task " + this.taskId);
    eventHandler.handle(new JobDiagnosticsUpdateEvent(this.taskId.getJobId(), "Invalid event " + type + " on Task " + this.taskId));
    eventHandler.handle(new JobEvent(this.taskId.getJobId(), JobEventType.INTERNAL_ERROR));
}
Also used : JobEvent(org.apache.hadoop.mapreduce.v2.app.job.event.JobEvent) JobDiagnosticsUpdateEvent(org.apache.hadoop.mapreduce.v2.app.job.event.JobDiagnosticsUpdateEvent)

Example 2 with TaskEventType

use of org.apache.hadoop.mapreduce.v2.app.job.event.TaskEventType in project hadoop by apache.

the class TestTaskImpl method runSpeculativeTaskAttemptSucceeds.

private void runSpeculativeTaskAttemptSucceeds(TaskEventType firstAttemptFinishEvent) {
    TaskId taskId = getNewTaskID();
    scheduleTaskAttempt(taskId);
    launchTaskAttempt(getLastAttempt().getAttemptId());
    updateLastAttemptState(TaskAttemptState.RUNNING);
    // Add a speculative task attempt that succeeds
    mockTask.handle(new TaskTAttemptEvent(getLastAttempt().getAttemptId(), TaskEventType.T_ADD_SPEC_ATTEMPT));
    launchTaskAttempt(getLastAttempt().getAttemptId());
    commitTaskAttempt(getLastAttempt().getAttemptId());
    mockTask.handle(new TaskTAttemptEvent(getLastAttempt().getAttemptId(), TaskEventType.T_ATTEMPT_SUCCEEDED));
    // The task should now have succeeded
    assertTaskSucceededState();
    // Now complete the first task attempt, after the second has succeeded
    mockTask.handle(new TaskTAttemptEvent(taskAttempts.get(0).getAttemptId(), firstAttemptFinishEvent));
    // The task should still be in the succeeded state
    assertTaskSucceededState();
    // The task should contain speculative a task attempt
    assertTaskAttemptAvataar(Avataar.SPECULATIVE);
}
Also used : TaskId(org.apache.hadoop.mapreduce.v2.api.records.TaskId) TaskTAttemptEvent(org.apache.hadoop.mapreduce.v2.app.job.event.TaskTAttemptEvent)

Aggregations

TaskId (org.apache.hadoop.mapreduce.v2.api.records.TaskId)1 JobDiagnosticsUpdateEvent (org.apache.hadoop.mapreduce.v2.app.job.event.JobDiagnosticsUpdateEvent)1 JobEvent (org.apache.hadoop.mapreduce.v2.app.job.event.JobEvent)1 TaskTAttemptEvent (org.apache.hadoop.mapreduce.v2.app.job.event.TaskTAttemptEvent)1