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.
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 keyvalue
- the entry valuenumPartitions
- the number of partitions
- Returns:
- the partition number
Copyright © 2006 The Apache Software Foundation