@InterfaceAudience.Public @InterfaceStability.Stable public interface Partitioner<K2,V2> extends JobConfigurable
Partitioner controls the partitioning of the keys of the
intermediate map-outputs. The key (or a subset of the key) is used to derive
the partition, typically by a hash function. The total number of partitions
is the same as the number of reduce tasks for the job. Hence this controls
which of the
m reduce tasks the intermediate key (and hence the
record) is sent for reduction.
|Modifier and Type||Method and Description|
Get the paritition number for a given key (hence record) given the total number of partitions i.e.
int getPartition(K2 key, V2 value, int numPartitions)
Typically a hash function on a all or a subset of the key.
key- the key to be paritioned.
value- the entry value.
numPartitions- the total number of partitions.
Copyright © 2015 Apache Software Foundation. All rights reserved.