kafka.partitioner package¶
Submodules¶
kafka.partitioner.base module¶
kafka.partitioner.hashed module¶
-
kafka.partitioner.hashed.
HashedPartitioner
¶
-
class
kafka.partitioner.hashed.
LegacyPartitioner
(partitions)[source]¶ Bases:
object
DEPRECATED – See Issue 374
Implements a partitioner which selects the target partition based on the hash of the key
-
class
kafka.partitioner.hashed.
Murmur2Partitioner
(partitions=None)[source]¶ Bases:
kafka.partitioner.base.Partitioner
Implements a partitioner which selects the target partition based on the hash of the key. Attempts to apply the same hashing function as mainline java client.
kafka.partitioner.roundrobin module¶
Module contents¶
-
class
kafka.partitioner.
DefaultPartitioner
[source]¶ Bases:
object
Default partitioner.
Hashes key to partition using murmur2 hashing (from java client) If key is None, selects partition randomly from available, or from all partitions if none are currently available
-
kafka.partitioner.
HashedPartitioner
¶
-
class
kafka.partitioner.
Murmur2Partitioner
(partitions=None)[source]¶ Bases:
kafka.partitioner.base.Partitioner
Implements a partitioner which selects the target partition based on the hash of the key. Attempts to apply the same hashing function as mainline java client.