Class RehashPartitioner<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.Partitioner<K,V>
org.apache.hadoop.mapreduce.lib.partition.RehashPartitioner<K,V>
This partitioner rehashes values returned by
Object.hashCode()
to get smoother distribution between partitions which may improve
reduce reduce time in some cases and should harm things in no cases.
This partitioner is suggested with Integer and Long keys with simple
patterns in their distributions.- Since:
- 2.0.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPartition(K key, V value, int numReduceTasks) RehashObject.hashCode()to partition.
-
Constructor Details
-
RehashPartitioner
public RehashPartitioner()
-
-
Method Details
-
getPartition
RehashObject.hashCode()to partition.- Specified by:
getPartitionin classPartitioner<K,V> - Parameters:
key- the key to be partioned.value- the entry value.numReduceTasks- the total number of partitions.- Returns:
- the partition number for the
key.
-