org.apache.hadoop.examples
Class WordMedian.WordMedianReducer
java.lang.Object
org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable>
org.apache.hadoop.examples.WordMedian.WordMedianReducer
- Enclosing class:
- WordMedian
public static class WordMedian.WordMedianReducer
- extends org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable>
Performs integer summation of all the values for each key.
| Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer |
org.apache.hadoop.mapreduce.Reducer.Context |
|
Method Summary |
void |
reduce(org.apache.hadoop.io.IntWritable key,
Iterable<org.apache.hadoop.io.IntWritable> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
Sums all the individual values within the iterator and writes them to the
same key. |
| Methods inherited from class org.apache.hadoop.mapreduce.Reducer |
cleanup, run, setup |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WordMedian.WordMedianReducer
public WordMedian.WordMedianReducer()
reduce
public void reduce(org.apache.hadoop.io.IntWritable key,
Iterable<org.apache.hadoop.io.IntWritable> values,
org.apache.hadoop.mapreduce.Reducer.Context context)
throws IOException,
InterruptedException
- Sums all the individual values within the iterator and writes them to the
same key.
- Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable>
- Parameters:
key - This will be a length of a word that was read.values - This will be an iterator of all the values associated with that
key.
- Throws:
IOException
InterruptedException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.