public final class HashPartitioner extends Object implements Partitioner
Partitioner
which hashes output data from a source task
according to the key of elements.
The data will be hashed by their key, and applied "modulo" operation by the number of destination tasks.Constructor and Description |
---|
HashPartitioner() |
Modifier and Type | Method and Description |
---|---|
List<Partition> |
partition(Iterable elements,
int dstParallelism,
KeyExtractor keyExtractor)
Divides the output data from a task into multiple blocks.
|
public List<Partition> partition(Iterable elements, int dstParallelism, KeyExtractor keyExtractor)
Partitioner
partition
in interface Partitioner
elements
- the output data from a source task.dstParallelism
- the number of destination tasks.keyExtractor
- extracts keys from elements.Copyright © 2018. All rights reserved.