public class MultithreadedMapper<K1,V1,K2,V2>
extends org.apache.hadoop.mapreduce.Mapper<K1,V1,K2,V2>
| Modifier and Type | Class and Description |
|---|---|
protected class |
MultithreadedMapper.MapRunner |
| Constructor and Description |
|---|
MultithreadedMapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
createRunners(int numRunners) |
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.
|
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(ThreadPoolExecutor pool)
Set the thread pool for this mapper.
|
void |
stopRunners(int numRunners) |
public int getThreadCount(org.apache.hadoop.mapreduce.Mapper.Context context)
public void setThreadCount(int threadCount)
threadCount - Thread count for this mapper.public void setThreadPool(ThreadPoolExecutor 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 typeconf - internalMapperClass - the class to use as the mapperpublic void createRunners(int numRunners)
throws IOException,
InterruptedException,
ClassNotFoundException
public void stopRunners(int numRunners)
public void run(org.apache.hadoop.mapreduce.Mapper.Context context)
throws IOException,
InterruptedException
run in class org.apache.hadoop.mapreduce.Mapper<K1,V1,K2,V2>IOExceptionInterruptedExceptionCopyright © 2022 MarkLogic Corporation
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com