Package org.apache.hadoop.mapred.lib
Class HashPartitioner<K2,V2>
java.lang.Object
org.apache.hadoop.mapred.lib.HashPartitioner<K2,V2>
- All Implemented Interfaces:
JobConfigurable,Partitioner<K2,V2>
Partition keys by their
Object.hashCode().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes a new instance from aJobConf.intgetPartition(K2 key, V2 value, int numReduceTasks) UseObject.hashCode()to partition.
-
Constructor Details
-
HashPartitioner
public HashPartitioner()
-
-
Method Details
-
configure
Description copied from interface:JobConfigurableInitializes a new instance from aJobConf.- Specified by:
configurein interfaceJobConfigurable- Parameters:
job- the configuration
-
getPartition
UseObject.hashCode()to partition.- Specified by:
getPartitionin interfacePartitioner<K2,V2> - Parameters:
key- the key to be paritioned.value- the entry value.numReduceTasks- the total number of partitions.- Returns:
- the partition number for the
key.
-