| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.Mapper<K1,V1,K2,V2>
org.apache.hadoop.mapreduce.lib.map.MultithreadedMapper<K1,V1,K2,V2>
@InterfaceAudience.Public @InterfaceStability.Stable public class MultithreadedMapper<K1,V1,K2,V2>
Multithreaded implementation for @link org.apache.hadoop.mapreduce.Mapper.
It can be used instead of the default implementation,
| Field Summary | |
|---|---|
| static String | MAP_CLASS | 
| static String | NUM_THREADS | 
| Constructor Summary | |
|---|---|
| MultithreadedMapper() | |
| Method Summary | ||
|---|---|---|
| static
 | getMapperClass(JobContext job)Get the application's mapper class. | |
| static int | getNumberOfThreads(JobContext job)The number of threads in the thread pool that will run the map function. | |
|  void | run(org.apache.hadoop.mapreduce.Mapper.Context context)Run the application's maps using a thread pool. | |
| static
 | setMapperClass(Job job,
                             Class<? extends Mapper<K1,V1,K2,V2>> cls)Set the application's mapper class. | |
| static void | setNumberOfThreads(Job job,
                                     int threads)Set the number of threads in the pool for running maps. | |
| Methods inherited from class org.apache.hadoop.mapreduce.Mapper | 
|---|
| cleanup, map, setup | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static String NUM_THREADS
public static String MAP_CLASS
| Constructor Detail | 
|---|
public MultithreadedMapper()
| Method Detail | 
|---|
public static int getNumberOfThreads(JobContext job)
job - the job
public static void setNumberOfThreads(Job job,
                                      int threads)
job - the job to modifythreads - the new number of threadspublic static <K1,V1,K2,V2> Class<Mapper<K1,V1,K2,V2>> getMapperClass(JobContext job)
K1 - the map's input key typeV1 - the map's input value typeK2 - the map's output key typeV2 - the map's output value typejob - the job
public static <K1,V1,K2,V2> void setMapperClass(Job job,
                                                Class<? extends Mapper<K1,V1,K2,V2>> cls)
K1 - the map input key typeV1 - the map input value typeK2 - the map output key typeV2 - the map output value typejob - the job to modifycls - the class to use as the mapper
public void run(org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException,
                InterruptedException
run in class Mapper<K1,V1,K2,V2>IOException
InterruptedException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||