@InterfaceAudience.Public @InterfaceStability.Stable public class RehashPartitioner<K,V> extends Partitioner<K,V>
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.Constructor and Description |
---|
RehashPartitioner() |
Modifier and Type | Method and Description |
---|---|
int |
getPartition(K key,
V value,
int numReduceTasks)
Rehash
Object.hashCode() to partition. |
public int getPartition(K key, V value, int numReduceTasks)
Object.hashCode()
to partition.getPartition
in class Partitioner<K,V>
key
- the key to be partioned.value
- the entry value.numReduceTasks
- the total number of partitions.key
.Copyright © 2018 Apache Software Foundation. All rights reserved.