cgl.imr.base
Class ReducerSelector

java.lang.Object
  extended by cgl.imr.base.ReducerSelector
Direct Known Subclasses:
HashBasedReducerSelector

public abstract class ReducerSelector
extends Object

This class and its specific implementation are used to group the outputs of the Map task to the Reduce task queues. In a typical MapReduce computation, all Map tasks can produce some result that maps to a particular Reduce task. So normally all the Map tasks have some output to go into all the Reduce tasks. This behavior can be change by extending this abstract class.


Field Summary
protected  String jobId
           
protected  int numReducers
           
protected  String sinkBase
           
 
Constructor Summary
  ReducerSelector()
           
protected ReducerSelector(int numReducers, String sinkBase, String jobId)
           
 
Method Summary
 void configure(JobConf jobConf, String reducerSink)
           
 String getJobId()
           
 int getNumReducers()
           
abstract  int getReducerNumber(Key key)
          Returns the reducer number for a given Key.
 String getSinkBase()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jobId

protected String jobId

numReducers

protected int numReducers

sinkBase

protected String sinkBase
Constructor Detail

ReducerSelector

public ReducerSelector()

ReducerSelector

protected ReducerSelector(int numReducers,
                          String sinkBase,
                          String jobId)
Method Detail

configure

public void configure(JobConf jobConf,
                      String reducerSink)

getJobId

public String getJobId()

getNumReducers

public int getNumReducers()

getReducerNumber

public abstract int getReducerNumber(Key key)
Returns the reducer number for a given Key. This mapping can be anything from Hashing to specific configuration such as one to one.

Parameters:
key -
Returns:
reducer number for this key.

getSinkBase

public String getSinkBase()


For comments and suggestions please send e-mail to