public class NonPersistentDispatcherMultipleConsumers extends AbstractDispatcherMultipleConsumers implements NonPersistentDispatcher
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.pulsar.common.stats.Rate |
msgDrop |
protected Subscription |
subscription |
protected static AtomicIntegerFieldUpdater<NonPersistentDispatcherMultipleConsumers> |
TOTAL_AVAILABLE_PERMITS_UPDATER |
consumerList, consumerSet, currentConsumerRoundRobinIndex, FALSE, IS_CLOSED_UPDATER, TRUEserviceConfig| Constructor and Description |
|---|
NonPersistentDispatcherMultipleConsumers(NonPersistentTopic topic,
Subscription subscription) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConsumer(Consumer consumer) |
boolean |
canUnsubscribe(Consumer consumer) |
CompletableFuture<Void> |
close()
mark dispatcher closed to stop new incoming requests and disconnect all consumers.
|
void |
consumerFlow(Consumer consumer,
int additionalNumberOfMessages)
Indicates that this consumer is now ready to receive more messages.
|
CompletableFuture<Void> |
disconnectActiveConsumers(boolean isResetCursor)
Disconnect active consumers.
|
CompletableFuture<Void> |
disconnectAllConsumers(boolean isResetCursor)
disconnect all consumers.
|
CopyOnWriteArrayList<Consumer> |
getConsumers() |
org.apache.pulsar.common.stats.Rate |
getMessageDropRate() |
RedeliveryTracker |
getRedeliveryTracker() |
org.apache.pulsar.common.api.proto.CommandSubscribe.SubType |
getType() |
boolean |
hasPermits() |
boolean |
isConsumerAvailable(Consumer consumer) |
boolean |
isConsumerConnected() |
protected boolean |
isConsumersExceededOnSubscription()
Determine whether the number of consumers on the subscription reaches the threshold.
|
void |
removeConsumer(Consumer consumer) |
void |
reset()
mark dispatcher open to serve new incoming requests.
|
void |
resetCloseFuture() |
void |
sendMessages(List<Entry> entries) |
cancelPendingRead, getNextConsumer, getRandomConsumer, isClosedcomputeReadLimits, filterEntriesForConsumer, filterEntriesForConsumer, isConsumersExceededOnSubscription, peekStickyKey, updateEntryWrapperWithMetadataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddUnAckedMessages, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessagescheckAndUnblockIfStuck, clearDelayedMessages, cursorIsReset, disconnectAllConsumers, getNumberOfDelayedMessages, getRateLimiter, initializeDispatchRateLimiterIfNeeded, isClosed, markDeletePositionMoveForward, trackDelayedDelivery, updateRateLimiterprotected final Subscription subscription
protected final org.apache.pulsar.common.stats.Rate msgDrop
protected static final AtomicIntegerFieldUpdater<NonPersistentDispatcherMultipleConsumers> TOTAL_AVAILABLE_PERMITS_UPDATER
public NonPersistentDispatcherMultipleConsumers(NonPersistentTopic topic, Subscription subscription)
public void addConsumer(Consumer consumer) throws BrokerServiceException
addConsumer in interface DispatcheraddConsumer in interface NonPersistentDispatcherBrokerServiceExceptionprotected boolean isConsumersExceededOnSubscription()
AbstractBaseDispatcherisConsumersExceededOnSubscription in class AbstractBaseDispatcherpublic void removeConsumer(Consumer consumer) throws BrokerServiceException
removeConsumer in interface DispatcherremoveConsumer in interface NonPersistentDispatcherBrokerServiceExceptionpublic boolean isConsumerConnected()
isConsumerConnected in interface DispatcherisConsumerConnected in interface NonPersistentDispatcherisConsumerConnected in class AbstractDispatcherMultipleConsumerspublic CopyOnWriteArrayList<Consumer> getConsumers()
getConsumers in interface DispatchergetConsumers in interface NonPersistentDispatchergetConsumers in class AbstractDispatcherMultipleConsumerspublic boolean canUnsubscribe(Consumer consumer)
canUnsubscribe in interface DispatchercanUnsubscribe in interface NonPersistentDispatchercanUnsubscribe in class AbstractDispatcherMultipleConsumerspublic CompletableFuture<Void> close()
Dispatcherclose in interface Dispatcherclose in interface NonPersistentDispatcherpublic void consumerFlow(Consumer consumer, int additionalNumberOfMessages)
DispatcherconsumerFlow in interface Dispatcherpublic CompletableFuture<Void> disconnectAllConsumers(boolean isResetCursor)
DispatcherdisconnectAllConsumers in interface DispatcherdisconnectAllConsumers in interface NonPersistentDispatcherpublic CompletableFuture<Void> disconnectActiveConsumers(boolean isResetCursor)
DispatcherdisconnectActiveConsumers in interface Dispatcherpublic void resetCloseFuture()
resetCloseFuture in interface DispatcherresetCloseFuture in class AbstractBaseDispatcherpublic void reset()
Dispatcherreset in interface Dispatcherreset in interface NonPersistentDispatcherpublic org.apache.pulsar.common.api.proto.CommandSubscribe.SubType getType()
getType in interface DispatchergetType in interface NonPersistentDispatchergetType in class AbstractDispatcherMultipleConsumerspublic RedeliveryTracker getRedeliveryTracker()
getRedeliveryTracker in interface Dispatcherpublic void sendMessages(List<Entry> entries)
sendMessages in interface NonPersistentDispatcherpublic boolean hasPermits()
hasPermits in interface NonPersistentDispatcherpublic org.apache.pulsar.common.stats.Rate getMessageDropRate()
getMessageDropRate in interface NonPersistentDispatcherpublic boolean isConsumerAvailable(Consumer consumer)
isConsumerAvailable in class AbstractDispatcherMultipleConsumersCopyright © 2017–2022 Apache Software Foundation. All rights reserved.