Package org.apache.hadoop.mapred.lib
Class MultithreadedMapRunner<K1,V1,K2,V2>
java.lang.Object
org.apache.hadoop.mapred.lib.MultithreadedMapRunner<K1,V1,K2,V2>
- All Implemented Interfaces:
JobConfigurable,MapRunnable<K1,V1, K2, V2>
@Public
@Stable
public class MultithreadedMapRunner<K1,V1,K2,V2>
extends Object
implements MapRunnable<K1,V1,K2,V2>
Multithreaded implementation for
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
MultithreadedMapRunner
public MultithreadedMapRunner()
-
-
Method Details
-
configure
Description copied from interface:JobConfigurableInitializes a new instance from aJobConf.- Specified by:
configurein interfaceJobConfigurable- Parameters:
jobConf- the configuration
-
run
public void run(RecordReader<K1, V1> input, OutputCollector<K2, throws IOExceptionV2> output, Reporter reporter) Description copied from interface:MapRunnableStart mapping input<key, value>pairs.Mapping of input records to output records is complete when this method returns.
- Specified by:
runin interfaceMapRunnable<K1,V1, K2, V2> - Parameters:
input- theRecordReaderto read the input records.output- theOutputCollectorto collect the outputrecords.reporter-Reporterto report progress, status-updates etc.- Throws:
IOException
-