org.apache.hadoop.mapred
Interface Partitioner

All Superinterfaces:
JobConfigurable
All Known Implementing Classes:
HashPartitioner, KeyFieldBasedPartitioner

public interface Partitioner
extends JobConfigurable

Partitions the key space. A partition is created for each reduce task.


Method Summary
 int getPartition(WritableComparable key, Writable value, int numPartitions)
          Returns the paritition number for a given entry given the total number of partitions.
 
Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable
configure
 

Method Detail

getPartition

int getPartition(WritableComparable key,
                 Writable value,
                 int numPartitions)
Returns the paritition number for a given entry given the total number of partitions. Typically a hash function on a all or a subset of the key.

Parameters:
key - the entry key
value - the entry value
numPartitions - the number of partitions
Returns:
the partition number


Copyright © 2006 The Apache Software Foundation