org.apache.hadoop.examples
Class WordCount.Reduce
java.lang.Object
org.apache.hadoop.mapred.MapReduceBase
org.apache.hadoop.examples.WordCount.Reduce
- All Implemented Interfaces:
- Closeable, JobConfigurable, Reducer
- Enclosing class:
- WordCount
public static class WordCount.Reduce
- extends MapReduceBase
- implements Reducer
A reducer class that just emits the sum of the input values.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WordCount.Reduce
public WordCount.Reduce()
reduce
public void reduce(WritableComparable key,
Iterator values,
OutputCollector output,
Reporter reporter)
throws IOException
- Description copied from interface:
Reducer
- Combines values for a given key. Output values must be of the same type
as input values. Input keys must not be altered. Typically all values
are combined into zero or one value. Output pairs are collected with
calls to
OutputCollector.collect(WritableComparable,Writable)
.
- Specified by:
reduce
in interface Reducer
- Parameters:
key
- the keyvalues
- the values to combineoutput
- to collect combined values
- Throws:
IOException
Copyright © 2006 The Apache Software Foundation