Package org.apache.pulsar.client.impl
Class RoundRobinPartitionMessageRouterImpl
java.lang.Object
org.apache.pulsar.client.impl.MessageRouterBase
org.apache.pulsar.client.impl.RoundRobinPartitionMessageRouterImpl
- All Implemented Interfaces:
Serializable
,MessageRouter
The routing strategy here:
- If a key is present, choose a partition based on a hash of the key.
- If no key is present, choose a partition in a "round-robin" fashion. Batching-Awareness is built-in to improve batching locality.
- See Also:
-
Field Summary
Fields inherited from class org.apache.pulsar.client.impl.MessageRouterBase
hash
-
Constructor Summary
ConstructorDescriptionRoundRobinPartitionMessageRouterImpl
(HashingScheme hashingScheme, int startPtnIdx, boolean isBatchingEnabled, long partitionSwitchMs) RoundRobinPartitionMessageRouterImpl
(HashingScheme hashingScheme, int startPtnIdx, boolean isBatchingEnabled, long partitionSwitchMs, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionint
choosePartition
(Message<?> msg, TopicMetadata topicMetadata) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.pulsar.client.api.MessageRouter
choosePartition
-
Constructor Details
-
RoundRobinPartitionMessageRouterImpl
public RoundRobinPartitionMessageRouterImpl(HashingScheme hashingScheme, int startPtnIdx, boolean isBatchingEnabled, long partitionSwitchMs) -
RoundRobinPartitionMessageRouterImpl
public RoundRobinPartitionMessageRouterImpl(HashingScheme hashingScheme, int startPtnIdx, boolean isBatchingEnabled, long partitionSwitchMs, Clock clock)
-
-
Method Details
-
choosePartition
-