Class HashPartitioner<K,V>
java.lang.Object
org.apache.hadoop.mapreduce.Partitioner<K,V>
org.apache.hadoop.mapreduce.lib.partition.HashPartitioner<K,V>
Partition keys by their
Object.hashCode().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPartition(K key, V value, int numReduceTasks) UseObject.hashCode()to partition.
-
Constructor Details
-
HashPartitioner
public HashPartitioner()
-
-
Method Details
-
getPartition
UseObject.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.
-