@InterfaceAudience.Public @InterfaceStability.Stable public class MultithreadedMapRunner<K1,V1,K2,V2> extends Object implements MapRunnable<K1,V1,K2,V2>
MapRunnable.
It can be used instead of the default implementation,
of MapRunner, when the Map
operation is not CPU bound in order to improve throughput.
Map implementations using this MapRunnable must be thread-safe.
The Map-Reduce job has to be configured to use this MapRunnable class (using
the JobConf.setMapRunnerClass method) and
the number of threads the thread-pool can use with the
mapred.map.multithreadedrunner.threads property, its default
value is 10 threads.
| Constructor and Description |
|---|
MultithreadedMapRunner() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(JobConf jobConf)
Initializes a new instance from a
JobConf. |
void |
run(RecordReader<K1,V1> input,
OutputCollector<K2,V2> output,
Reporter reporter)
Start mapping input <key, value> pairs.
|
public void configure(JobConf jobConf)
JobConfigurableJobConf.configure in interface JobConfigurablejobConf - the configurationpublic void run(RecordReader<K1,V1> input, OutputCollector<K2,V2> output, Reporter reporter) throws IOException
MapRunnableMapping of input records to output records is complete when this method returns.
run in interface MapRunnable<K1,V1,K2,V2>input - the RecordReader to read the input records.output - the OutputCollector to collect the outputrecords.reporter - Reporter to report progress, status-updates etc.IOExceptionCopyright © 2019 Apache Software Foundation. All rights reserved.