Search in sources :

Example 16 with TaskTAttemptEvent

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

the class TestTaskImpl method testSpeculativeMapMultipleSucceedFetchFailure.

@Test
public void testSpeculativeMapMultipleSucceedFetchFailure() {
    // Setup a scenario where speculative task wins, first attempt succeeds
    mockTask = createMockTask(TaskType.MAP);
    runSpeculativeTaskAttemptSucceeds(TaskEventType.T_ATTEMPT_SUCCEEDED);
    assertEquals(2, taskAttempts.size());
    // speculative attempt retroactively fails from fetch failures
    mockTask.handle(new TaskTAttemptEvent(taskAttempts.get(1).getAttemptId(), TaskEventType.T_ATTEMPT_FAILED));
    assertTaskScheduledState();
    assertEquals(3, taskAttempts.size());
}
Also used : TaskTAttemptEvent(org.apache.hadoop.mapreduce.v2.app.job.event.TaskTAttemptEvent) Test(org.junit.Test)

Aggregations

TaskTAttemptEvent (org.apache.hadoop.mapreduce.v2.app.job.event.TaskTAttemptEvent)16 Test (org.junit.Test)11 TaskId (org.apache.hadoop.mapreduce.v2.api.records.TaskId)7 TaskEvent (org.apache.hadoop.mapreduce.v2.app.job.event.TaskEvent)4 Configuration (org.apache.hadoop.conf.Configuration)2 Task (org.apache.hadoop.mapreduce.v2.app.job.Task)2 TaskAttempt (org.apache.hadoop.mapreduce.v2.app.job.TaskAttempt)2 TaskTAttemptKilledEvent (org.apache.hadoop.mapreduce.v2.app.job.event.TaskTAttemptKilledEvent)2 Counter (org.apache.hadoop.mapreduce.Counter)1 Counters (org.apache.hadoop.mapreduce.Counters)1 OutputCommitter (org.apache.hadoop.mapreduce.OutputCommitter)1 TaskCounter (org.apache.hadoop.mapreduce.TaskCounter)1 JobHistoryEvent (org.apache.hadoop.mapreduce.jobhistory.JobHistoryEvent)1 TaskAttemptUnsuccessfulCompletionEvent (org.apache.hadoop.mapreduce.jobhistory.TaskAttemptUnsuccessfulCompletionEvent)1 JobId (org.apache.hadoop.mapreduce.v2.api.records.JobId)1 TaskAttemptId (org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId)1 CommitterEventHandler (org.apache.hadoop.mapreduce.v2.app.commit.CommitterEventHandler)1 Job (org.apache.hadoop.mapreduce.v2.app.job.Job)1 JobEvent (org.apache.hadoop.mapreduce.v2.app.job.event.JobEvent)1 JobTaskEvent (org.apache.hadoop.mapreduce.v2.app.job.event.JobTaskEvent)1