public class MultithreadedMapper<K1,V1,K2,V2>
extends org.apache.hadoop.mapreduce.Mapper<K1,V1,K2,V2>
Constructor and Description |
---|
MultithreadedMapper() |
Modifier and Type | Method and Description |
---|---|
static <K1,V1,K2,V2> |
getMapperClass(org.apache.hadoop.mapreduce.JobContext job)
Get the application's mapper class.
|
static int |
getNumberOfThreads(org.apache.hadoop.mapreduce.JobContext job)
The number of threads in the thread pool that will run the map function.
|
int |
getThreadCount(org.apache.hadoop.mapreduce.Mapper.Context context)
Get thread count set for this mapper.
|
ExecutorService |
getThreadPool()
Get a thread pool to be used for this mapper.
|
void |
run(org.apache.hadoop.mapreduce.Mapper.Context context)
Run the application's maps using a thread pool.
|
static <K1,V1,K2,V2> |
setMapperClass(org.apache.hadoop.conf.Configuration conf,
Class<? extends BaseMapper<?,?,?,?>> internalMapperClass)
Set the application's mapper class.
|
static void |
setNumberOfThreads(org.apache.hadoop.conf.Configuration conf,
int threads) |
static void |
setNumberOfThreads(org.apache.hadoop.mapreduce.Job job,
int threads)
Set the number of threads in the pool for running maps.
|
void |
setThreadCount(int threadCount)
Set thread count for this mapper.
|
void |
setThreadPool(ExecutorService pool)
Set the thread pool for this mapper.
|
public int getThreadCount(org.apache.hadoop.mapreduce.Mapper.Context context)
public void setThreadCount(int threadCount)
threadCount
- Thread count for this mapper.public ExecutorService getThreadPool()
public void setThreadPool(ExecutorService pool)
pool
- thread pool to be used for this mapper.public static int getNumberOfThreads(org.apache.hadoop.mapreduce.JobContext job)
job
- the jobpublic static void setNumberOfThreads(org.apache.hadoop.mapreduce.Job job, int threads)
job
- the job to modifythreads
- the new number of threadspublic static void setNumberOfThreads(org.apache.hadoop.conf.Configuration conf, int threads)
public static <K1,V1,K2,V2> Class<BaseMapper<K1,V1,K2,V2>> getMapperClass(org.apache.hadoop.mapreduce.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 jobpublic static <K1,V1,K2,V2> void setMapperClass(org.apache.hadoop.conf.Configuration conf, Class<? extends BaseMapper<?,?,?,?>> internalMapperClass)
K1
- the map input key typeV1
- the map input value typeK2
- the map output key typeV2
- the map output value typejob
- the job to modifyinternalMapperClass
- the class to use as the mapperpublic void run(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException
run
in class org.apache.hadoop.mapreduce.Mapper<K1,V1,K2,V2>
IOException
InterruptedException
Copyright © 2020 MarkLogic Corporation
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com