HashPartitioner is a Partitioner for hash-based partitioning.
HashPartitioner places null keys in 0th partition.
HashPartitioner is used as the default Partitioner.
HashPartitioner takes the following to be created:
- Number of partitions
Number of Partitions¶
numPartitions returns the given number of partitions.
numPartitions is part of the Partitioner abstraction.
Partition for Key¶
getPartition( key: Any): Int
getPartition simply returns
getPartition is part of the Partitioner abstraction.