Search in sources :

Example 11 with TaskState

use of org.apache.hadoop.mapreduce.v2.api.records.TaskState in project hadoop by apache.

the class TestTaskImpl method testKillScheduledTaskAttempt.

@Test
public /**
   * Kill attempt
   * {@link TaskState#SCHEDULED}->{@link TaskState#SCHEDULED}
   */
void testKillScheduledTaskAttempt() {
    LOG.info("--- START: testKillScheduledTaskAttempt ---");
    mockTask = createMockTask(TaskType.MAP);
    TaskId taskId = getNewTaskID();
    scheduleTaskAttempt(taskId);
    killScheduledTaskAttempt(getLastAttempt().getAttemptId(), true);
    assertEquals(TaskAttemptEventType.TA_RESCHEDULE, taskAttemptEventHandler.lastTaskAttemptEvent.getType());
}
Also used : TaskId(org.apache.hadoop.mapreduce.v2.api.records.TaskId) Test(org.junit.Test)

Aggregations

TaskId (org.apache.hadoop.mapreduce.v2.api.records.TaskId)7 Test (org.junit.Test)6 Counters (org.apache.hadoop.mapreduce.Counters)2 TaskAttemptID (org.apache.hadoop.mapreduce.TaskAttemptID)2 JobHistoryEvent (org.apache.hadoop.mapreduce.jobhistory.JobHistoryEvent)2 TaskAttemptId (org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId)2 TaskReport (org.apache.hadoop.mapreduce.v2.api.records.TaskReport)2 TaskAttempt (org.apache.hadoop.mapreduce.v2.app.job.TaskAttempt)2 JobTaskEvent (org.apache.hadoop.mapreduce.v2.app.job.event.JobTaskEvent)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 RemoteException (org.apache.hadoop.ipc.RemoteException)1 JobConf (org.apache.hadoop.mapred.JobConf)1 Job (org.apache.hadoop.mapreduce.Job)1 JobID (org.apache.hadoop.mapreduce.JobID)1 JobPriority (org.apache.hadoop.mapreduce.JobPriority)1 JobStatus (org.apache.hadoop.mapreduce.JobStatus)1 Event (org.apache.hadoop.mapreduce.jobhistory.Event)1