p2pMapReduce.mapreduceModule.output
Class HashPartitioner<K2,V2>

java.lang.Object
  extended by p2pMapReduce.mapreduceModule.Partitioner<K2,V2>
      extended by p2pMapReduce.mapreduceModule.output.HashPartitioner<K2,V2>

public class HashPartitioner<K2,V2>
extends Partitioner<K2,V2>

Partition keys by their Object.hashCode().


Constructor Summary
HashPartitioner()
           
 
Method Summary
 void configure(JobConf job)
           
 int getPartition(K2 key, V2 value, int numReduceTasks)
          Use Object.hashCode() to partition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashPartitioner

public HashPartitioner()
Method Detail

configure

public void configure(JobConf job)

getPartition

public int getPartition(K2 key,
                        V2 value,
                        int numReduceTasks)
Use Object.hashCode() to partition.

Specified by:
getPartition in class Partitioner<K2,V2>
Parameters:
key - the key to be partioned.
value - the entry value.
numReduceTasks - the total number of partitions.
Returns:
the partition number for the key.