Search in sources :

Example 1 with MapRunnable

use of org.apache.hadoop.mapred.MapRunnable in project tez by apache.

the class MapProcessor method runOldMapper.

void runOldMapper(final JobConf job, final MRTaskReporter reporter, final MRInputLegacy input, final KeyValueWriter output) throws IOException, InterruptedException {
    // Initialize input in-line since it sets parameters which may be used by the processor.
    // Done only for MRInput.
    // TODO use new method in MRInput to get required info
    // input.initialize(job, master);
    InputSplit inputSplit = input.getOldInputSplit();
    updateJobWithSplit(job, inputSplit);
    RecordReader in = new OldRecordReader(input);
    OutputCollector collector = new OldOutputCollector(output);
    MapRunnable runner = (MapRunnable) ReflectionUtils.newInstance(job.getMapRunnerClass(), job);
    runner.run(in, collector, (Reporter) reporter);
    // Set progress to 1.0f if there was no exception,
    reporter.setProgress(1.0f);
    // start the sort phase only if there are reducers
    this.statusUpdate();
}
Also used : OutputCollector(org.apache.hadoop.mapred.OutputCollector) MapRunnable(org.apache.hadoop.mapred.MapRunnable) RecordReader(org.apache.hadoop.mapred.RecordReader) InputSplit(org.apache.hadoop.mapred.InputSplit)

Aggregations

InputSplit (org.apache.hadoop.mapred.InputSplit)1 MapRunnable (org.apache.hadoop.mapred.MapRunnable)1 OutputCollector (org.apache.hadoop.mapred.OutputCollector)1 RecordReader (org.apache.hadoop.mapred.RecordReader)1