/** * Test of getTaskType method, of class TaskID. */ @Test public void testGetTaskTypeChar() { assertEquals("The getTaskType() method did not return the expected type", TaskType.MAP, TaskID.getTaskType('m')); assertEquals("The getTaskType() method did not return the expected type", TaskType.REDUCE, TaskID.getTaskType('r')); assertEquals("The getTaskType() method did not return the expected type", TaskType.JOB_SETUP, TaskID.getTaskType('s')); assertEquals("The getTaskType() method did not return the expected type", TaskType.JOB_CLEANUP, TaskID.getTaskType('c')); assertEquals("The getTaskType() method did not return the expected type", TaskType.TASK_CLEANUP, TaskID.getTaskType('t')); assertNull("The getTaskType() method did not return null for an unknown " + "type", TaskID.getTaskType('x')); }
/** * Test of getTaskType method, of class TaskID. */ @Test public void testGetTaskType0args() { JobID jobId = new JobID("1234", 0); for (TaskType type : TaskType.values()) { TaskID taskId = new TaskID(jobId, type, 0); assertEquals("TaskID incorrectly reported its type", type, taskId.getTaskType()); } TaskID taskId = new TaskID(); assertEquals("TaskID of default type incorrectly reported its type", TaskType.REDUCE, taskId.getTaskType()); }
/**Returns the TaskType of the TaskAttemptID */ public TaskType getTaskType() { return taskId.getTaskType(); } @Override
/**Returns the TaskType of the TaskAttemptID */ public TaskType getTaskType() { return taskId.getTaskType(); } @Override
/**Returns the TaskType of the TaskAttemptID */ public TaskType getTaskType() { return taskId.getTaskType(); } @Override
/**Returns the TaskType of the TaskAttemptID */ public TaskType getTaskType() { return taskId.getTaskType(); } @Override
/**Returns the TaskType of the TaskAttemptID */ public TaskType getTaskType() { return taskId.getTaskType(); } @Override
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_FINISHED : EventType.REDUCE_ATTEMPT_FINISHED; }
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_STARTED : EventType.REDUCE_ATTEMPT_STARTED; } /** Get the ContainerId */
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_FINISHED : EventType.REDUCE_ATTEMPT_FINISHED; }
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_FINISHED : EventType.REDUCE_ATTEMPT_FINISHED; }
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_STARTED : EventType.REDUCE_ATTEMPT_STARTED; } /** Get the ContainerId */
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_FINISHED : EventType.REDUCE_ATTEMPT_FINISHED; }
/** Get the event type */ public EventType getEventType() { // Note that the task type can be setup/map/reduce/cleanup but the // attempt-type can only be map/reduce. return getTaskId().getTaskType() == TaskType.MAP ? EventType.MAP_ATTEMPT_STARTED : EventType.REDUCE_ATTEMPT_STARTED; } /** Get the ContainerId */
/** * Mask the job ID part in a {@link TaskID}. * * @param taskId * raw {@link TaskID} read from trace * @return masked {@link TaskID} with empty {@link JobID}. */ private TaskID maskTaskID(TaskID taskId) { JobID jobId = new JobID(); TaskType taskType = taskId.getTaskType(); return new TaskID(jobId, taskType, taskId.getId()); }
public static TezTaskID fromMRTaskId(org.apache.hadoop.mapreduce.TaskID taskid) { return TezTaskID.getInstance( TezVertexID.getInstance(fromMRJobId(taskid.getJobID()), (taskid.getTaskType() == TaskType.MAP ? 0 : 1) ), taskid.getId()); }
public static TaskId toYarn(org.apache.hadoop.mapreduce.TaskID id) { TaskId taskId = recordFactory.newRecordInstance(TaskId.class); taskId.setId(id.getId()); taskId.setTaskType(toYarn(id.getTaskType())); taskId.setJobId(toYarn(id.getJobID())); return taskId; }
public static TaskId toYarn(org.apache.hadoop.mapreduce.TaskID id) { TaskId taskId = recordFactory.newRecordInstance(TaskId.class); taskId.setId(id.getId()); taskId.setTaskType(toYarn(id.getTaskType())); taskId.setJobId(toYarn(id.getJobID())); return taskId; }
public static TaskId toYarn(org.apache.hadoop.mapreduce.TaskID id) { TaskId taskId = recordFactory.newRecordInstance(TaskId.class); taskId.setId(id.getId()); taskId.setTaskType(toYarn(id.getTaskType())); taskId.setJobId(toYarn(id.getJobID())); return taskId; }
public static TaskId toYarn(org.apache.hadoop.mapreduce.TaskID id) { TaskId taskId = recordFactory.newRecordInstance(TaskId.class); taskId.setId(id.getId()); taskId.setTaskType(toYarn(id.getTaskType())); taskId.setJobId(toYarn(id.getJobID())); return taskId; }