org.apache.nutch.mapReduce
Interface Partitioner

All Superinterfaces:
Configurable
All Known Implementing Classes:
HashPartitioner

public interface Partitioner
extends Configurable

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


Method Summary
 int getPartition(WritableComparable key, int numPartitions)
          Returns the paritition number for a given key given the total number of partitions.
 
Methods inherited from interface org.apache.nutch.mapReduce.Configurable
configure
 

Method Detail

getPartition

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

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


Copyright © 2006 The Apache Software Foundation