org.apache.nutch.mapReduce
Interface Reducer

All Superinterfaces:
Configurable
All Known Implementing Classes:
IdentityReducer, LongSumReducer

public interface Reducer
extends Configurable

Reduces a set of intermediate values which share a key to a smaller set of values. Input values are the grouped output of a Mapper.


Method Summary
 void reduce(WritableComparable key, Iterator values, OutputCollector output)
          Combines values for a given key.
 
Methods inherited from interface org.apache.nutch.mapReduce.Configurable
configure
 

Method Detail

reduce

public void reduce(WritableComparable key,
                   Iterator values,
                   OutputCollector output)
            throws IOException
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).

Parameters:
key - the key
values - the values to combine
output - to collect combined values
Throws:
IOException


Copyright © 2006 The Apache Software Foundation