本文整理汇总了Java中org.apache.hadoop.mapred.MapRunnable类的典型用法代码示例。如果您正苦于以下问题:Java MapRunnable类的具体用法?Java MapRunnable怎么用?Java MapRunnable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapRunnable类属于org.apache.hadoop.mapred包,在下文中一共展示了MapRunnable类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runOldMapper
import org.apache.hadoop.mapred.MapRunnable; //导入依赖的package包/类
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();
}
示例2: setMapRunnerClass
import org.apache.hadoop.mapred.MapRunnable; //导入依赖的package包/类
@Override
public void setMapRunnerClass( Class c ) {
super.setMapRunnerClass( (Class<? extends MapRunnable>) c );
}