public abstract class MapReduceTask<K1,V1,K2,V2,V3> extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
numMapTasks |
protected int |
numReduceTasks |
protected boolean |
printTimes |
Modifier | Constructor and Description |
---|---|
protected |
MapReduceTask(int numMapTasks,
int numReduceTasks,
boolean printTimes)
Constructor for MapReduceTask.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
map(K1 inKey,
V1 inValue,
Aggregator<K2,V2> aggregator)
The MAP function.
|
abstract Map<K1,List<V1>> |
partition(int partitionIndex)
PARTITION the input to be divided into the MAP tasks.
|
abstract V3 |
reduce(K2 inKey,
List<V2> inValue,
V3 initialValue)
The REDUCE function.
|
abstract V3 |
reduceIdentity(K2 inKey)
reduceIdentity.
|
List<V3> |
results()
results.
|
void |
run()
run.
|
protected final int numMapTasks
protected final int numReduceTasks
protected final boolean printTimes
protected MapReduceTask(int numMapTasks, int numReduceTasks, boolean printTimes)
Constructor for MapReduceTask.
numMapTasks
- a int.numReduceTasks
- a int.printTimes
- a boolean.public final void run() throws SuspendableException
run.
SuspendableException
public abstract Map<K1,List<V1>> partition(int partitionIndex)
partitionIndex
- The index of partition to create.public abstract void map(K1 inKey, V1 inValue, Aggregator<K2,V2> aggregator)
inKey
- The input key.inValue
- The input value.aggregator
- Stores the intermediates.public abstract V3 reduceIdentity(K2 inKey)
reduceIdentity.
inKey
- The input key.Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.