org.apache.hadoop.streaming
Class PipeReducer

java.lang.Object
  extended by org.apache.hadoop.streaming.PipeMapRed
      extended by org.apache.hadoop.streaming.PipeReducer
All Implemented Interfaces:
Closeable, JobConfigurable, Reducer

public class PipeReducer
extends PipeMapRed
implements Reducer

A generic Reducer bridge. It delegates operations to an external program via stdin and stdout.

Author:
Michel Tourn

Field Summary
 
Fields inherited from class org.apache.hadoop.streaming.PipeMapRed
LOG, mapOutputFieldSeparator, numOfMapOutputKeyFields, numOfMapOutputPartitionFields, numOfReduceOutputKeyFields, outerrThreadsThrowable, reduceOutFieldSeparator
 
Constructor Summary
PipeReducer()
           
 
Method Summary
 void close()
          Called after the last call to any other method on this object to free and/or flush resources.
 void reduce(WritableComparable key, Iterator values, OutputCollector output, Reporter reporter)
          Combines values for a given key.
 
Methods inherited from class org.apache.hadoop.streaming.PipeMapRed
configure, getContext, mapRedFinished
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable
configure
 

Constructor Detail

PipeReducer

public PipeReducer()
Method Detail

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 key
values - the values to combine
output - to collect combined values
Throws:
IOException

close

public void close()
Description copied from interface: Closeable
Called after the last call to any other method on this object to free and/or flush resources. Typical implementations do nothing.

Specified by:
close in interface Closeable


Copyright © 2006 The Apache Software Foundation