@InterfaceAudience.Public @InterfaceStability.Stable public class HashPartitioner<K2,V2> extends Object implements Partitioner<K2,V2>
Object.hashCode()
.Constructor and Description |
---|
HashPartitioner() |
Modifier and Type | Method and Description |
---|---|
void |
configure(JobConf job)
Initializes a new instance from a
JobConf . |
int |
getPartition(K2 key,
V2 value,
int numReduceTasks)
Use
Object.hashCode() to partition. |
public HashPartitioner()
public void configure(JobConf job)
JobConfigurable
JobConf
.configure
in interface JobConfigurable
job
- the configurationpublic int getPartition(K2 key, V2 value, int numReduceTasks)
Object.hashCode()
to partition.getPartition
in interface Partitioner<K2,V2>
key
- the key to be paritioned.value
- the entry value.numReduceTasks
- the total number of partitions.key
.Copyright © 2018 Apache Software Foundation. All rights reserved.