Example usage for org.apache.hadoop.mapreduce TaskType JOB_CLEANUP

List of usage examples for org.apache.hadoop.mapreduce TaskType JOB_CLEANUP

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce TaskType JOB_CLEANUP.

Prototype

TaskType JOB_CLEANUP

To view the source code for org.apache.hadoop.mapreduce TaskType JOB_CLEANUP.

Click Source Link

Usage

From source file:cascading.stats.hadoop.HadoopNodeStats.java

License:Open Source License

/**
 * Retrieves the TaskReports via the mapreduce API.
 *
 * @param kind The kind of TaskReport to retrieve.
 * @return An array of TaskReports, but never <code>nul</code>.
 * @throws IOException//from  w w w  .  j a  v a  2  s  .c om
 */
private TaskReport[] retrieveTaskReports(HadoopSliceStats.Kind kind) throws IOException, InterruptedException {
    Job job = HadoopStepStats.getJob(getJobStatusClient());

    if (job == null)
        return new TaskReport[0];

    switch (kind) {
    case MAPPER:
        return job.getTaskReports(TaskType.MAP);
    case REDUCER:
        return job.getTaskReports(TaskType.REDUCE);
    case SETUP:
        return job.getTaskReports(TaskType.JOB_SETUP);
    case CLEANUP:
        return job.getTaskReports(TaskType.JOB_CLEANUP);
    default:
        return new TaskReport[0];
    }
}

From source file:org.apache.beam.sdk.io.hadoop.format.HadoopFormats.java

License:Apache License

/**
 * Creates cleanup {@link TaskAttemptContext} for given {@link JobID}.
 *
 * @param conf hadoop configuration//w  w  w  . ja  v  a2  s .co m
 * @param jobID jobId of the created {@link TaskID}
 * @return new cleanup {@link TaskID} for given {@link JobID}
 */
static TaskAttemptContext createCleanupTaskContext(Configuration conf, JobID jobID) {
    final TaskID taskId = new TaskID(jobID, TaskType.JOB_CLEANUP, 0);
    return createTaskAttemptContext(conf, new TaskAttemptID(taskId, 0));
}

From source file:org.apache.ignite.internal.processors.hadoop.impl.v2.HadoopV2TaskContext.java

License:Apache License

/**
 * @param type Task type.//from ww w.j  ava  2  s  . c  om
 * @return Hadoop task type.
 */
private TaskType taskType(HadoopTaskType type) {
    switch (type) {
    case SETUP:
        return TaskType.JOB_SETUP;
    case MAP:
    case COMBINE:
        return TaskType.MAP;

    case REDUCE:
        return TaskType.REDUCE;

    case COMMIT:
    case ABORT:
        return TaskType.JOB_CLEANUP;

    default:
        return null;
    }
}

From source file:org.apache.ignite.internal.processors.hadoop.v2.GridHadoopV2TaskContext.java

License:Apache License

/**
 * @param type Task type.//from w  ww.  ja v a2  s  .  c  o m
 * @return Hadoop task type.
 */
private TaskType taskType(GridHadoopTaskType type) {
    switch (type) {
    case SETUP:
        return TaskType.JOB_SETUP;
    case MAP:
    case COMBINE:
        return TaskType.MAP;

    case REDUCE:
        return TaskType.REDUCE;

    case COMMIT:
    case ABORT:
        return TaskType.JOB_CLEANUP;

    default:
        return null;
    }
}