public class WordCount extends MapReduceTask<Void,edu.rice.hj.runtime.mapreduce2.KeyString,edu.rice.hj.runtime.mapreduce2.KeyString,Integer,Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer>>
WordCount class.
numMapTasks, numReduceTasks, printTimes
Modifier | Constructor and Description |
---|---|
protected |
WordCount(int numMapTasks,
int numReduceTasks,
boolean printTimes,
String fileName)
Constructor for WordCount.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
main.
|
void |
map(Void inKey,
edu.rice.hj.runtime.mapreduce2.KeyString inValue,
Aggregator<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> aggregator)
The MAP function.
|
Map<Void,List<edu.rice.hj.runtime.mapreduce2.KeyString>> |
partition(int partitionId)
PARTITION the input to be divided into the MAP tasks.
|
Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> |
reduce(edu.rice.hj.runtime.mapreduce2.KeyString inKey,
List<Integer> inValue,
Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> initialValue)
The REDUCE function.
|
Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> |
reduceIdentity(edu.rice.hj.runtime.mapreduce2.KeyString inKey)
reduceIdentity.
|
results, run
public Map<Void,List<edu.rice.hj.runtime.mapreduce2.KeyString>> partition(int partitionId)
partition
in class MapReduceTask<Void,edu.rice.hj.runtime.mapreduce2.KeyString,edu.rice.hj.runtime.mapreduce2.KeyString,Integer,Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer>>
partitionId
- The index of partition to create.public void map(Void inKey, edu.rice.hj.runtime.mapreduce2.KeyString inValue, Aggregator<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> aggregator)
public Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> reduceIdentity(edu.rice.hj.runtime.mapreduce2.KeyString inKey)
reduceIdentity.
reduceIdentity
in class MapReduceTask<Void,edu.rice.hj.runtime.mapreduce2.KeyString,edu.rice.hj.runtime.mapreduce2.KeyString,Integer,Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer>>
inKey
- The input key.public Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> reduce(edu.rice.hj.runtime.mapreduce2.KeyString inKey, List<Integer> inValue, Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer> initialValue)
reduce
in class MapReduceTask<Void,edu.rice.hj.runtime.mapreduce2.KeyString,edu.rice.hj.runtime.mapreduce2.KeyString,Integer,Pair<edu.rice.hj.runtime.mapreduce2.KeyString,Integer>>
inKey
- The input key.inValue
- The input value.initialValue
- The current value representing the given key.Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.