public interface StickyKeyConsumerSelector
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RANGE_SIZE |
| Modifier and Type | Method and Description |
|---|---|
void |
addConsumer(Consumer consumer)
Add a new consumer.
|
Map<Consumer,List<org.apache.pulsar.client.api.Range>> |
getConsumerKeyHashRanges()
Get key hash ranges handled by each consumer.
|
static int |
makeStickyKeyHash(byte[] stickyKey) |
void |
removeConsumer(Consumer consumer)
Remove the consumer.
|
default Consumer |
select(byte[] stickyKey)
Select a consumer by sticky key.
|
Consumer |
select(int hash)
Select a consumer by hash.
|
static final int DEFAULT_RANGE_SIZE
void addConsumer(Consumer consumer) throws BrokerServiceException.ConsumerAssignException
consumer - new consumerBrokerServiceException.ConsumerAssignExceptionvoid removeConsumer(Consumer consumer)
consumer - consumer to be removeddefault Consumer select(byte[] stickyKey)
stickyKey - sticky keystatic int makeStickyKeyHash(byte[] stickyKey)
Consumer select(int hash)
hash - hash corresponding to sticky keyCopyright © 2017–2022 Apache Software Foundation. All rights reserved.