Class NonPersistentDispatcherMultipleConsumers
java.lang.Object
org.apache.pulsar.broker.service.EntryFilterSupport
org.apache.pulsar.broker.service.AbstractBaseDispatcher
org.apache.pulsar.broker.service.AbstractDispatcherMultipleConsumers
org.apache.pulsar.broker.service.nonpersistent.NonPersistentDispatcherMultipleConsumers
- All Implemented Interfaces:
Dispatcher,NonPersistentDispatcher
- Direct Known Subclasses:
NonPersistentStickyKeyDispatcherMultipleConsumers
public class NonPersistentDispatcherMultipleConsumers
extends AbstractDispatcherMultipleConsumers
implements NonPersistentDispatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.pulsar.common.stats.Rateprotected final Subscriptionprotected static final AtomicIntegerFieldUpdater<NonPersistentDispatcherMultipleConsumers>Fields inherited from class org.apache.pulsar.broker.service.AbstractDispatcherMultipleConsumers
consumerList, consumerSet, currentConsumerRoundRobinIndex, FALSE, IS_CLOSED_UPDATER, TRUEFields inherited from class org.apache.pulsar.broker.service.AbstractBaseDispatcher
dispatchThrottlingOnBatchMessageEnabled, serviceConfigFields inherited from class org.apache.pulsar.broker.service.EntryFilterSupport
entryFilters, filterContext -
Constructor Summary
ConstructorsConstructorDescriptionNonPersistentDispatcherMultipleConsumers(NonPersistentTopic topic, Subscription subscription) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsumer(Consumer consumer) booleancanUnsubscribe(Consumer consumer) close()mark dispatcher closed to stop new incoming requests and disconnect all consumers.voidconsumerFlow(Consumer consumer, int additionalNumberOfMessages) Indicates that this consumer is now ready to receive more messages.disconnectActiveConsumers(boolean isResetCursor) Disconnect active consumers.disconnectAllConsumers(boolean isResetCursor) disconnect all consumers.org.apache.pulsar.common.stats.Rateorg.apache.pulsar.common.api.proto.CommandSubscribe.SubTypegetType()booleanbooleanisConsumerAvailable(Consumer consumer) booleanprotected booleanDetermine whether the number of consumers on the subscription reaches the threshold.voidremoveConsumer(Consumer consumer) protected voidvoidreset()mark dispatcher open to serve new incoming requests.voidvoidsendMessages(List<org.apache.bookkeeper.mledger.Entry> entries) Methods inherited from class org.apache.pulsar.broker.service.AbstractDispatcherMultipleConsumers
cancelPendingRead, getNextConsumer, getRandomConsumer, isClosedMethods inherited from class org.apache.pulsar.broker.service.AbstractBaseDispatcher
computeReadLimits, filterEntriesForConsumer, filterEntriesForConsumer, getFilterAcceptedMsgCount, getFilterProcessedMsgCount, getFilterRejectedMsgCount, getFilterRescheduledMsgCount, getSubscriptionName, isConsumersExceededOnSubscription, peekStickyKey, reachDispatchRateLimit, updateMessagesToRead, updatePendingBytesToDispatchMethods inherited from class org.apache.pulsar.broker.service.EntryFilterSupport
runFiltersForEntryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.broker.service.Dispatcher
checkAndUnblockIfStuck, clearDelayedMessages, cursorIsReset, disconnectAllConsumers, getFilterAcceptedMsgCount, getFilterProcessedMsgCount, getFilterRejectedMsgCount, getFilterRescheduledMsgCount, getNumberOfDelayedMessages, getRateLimiter, initializeDispatchRateLimiterIfNeeded, isClosed, markDeletePositionMoveForward, trackDelayedDelivery, updateRateLimiterMethods inherited from interface org.apache.pulsar.broker.service.nonpersistent.NonPersistentDispatcher
addUnAckedMessages, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages
-
Field Details
-
subscription
-
msgDrop
protected final org.apache.pulsar.common.stats.Rate msgDrop -
TOTAL_AVAILABLE_PERMITS_UPDATER
protected static final AtomicIntegerFieldUpdater<NonPersistentDispatcherMultipleConsumers> TOTAL_AVAILABLE_PERMITS_UPDATER
-
-
Constructor Details
-
NonPersistentDispatcherMultipleConsumers
public NonPersistentDispatcherMultipleConsumers(NonPersistentTopic topic, Subscription subscription)
-
-
Method Details
-
addConsumer
- Specified by:
addConsumerin interfaceDispatcher- Throws:
BrokerServiceException
-
isConsumersExceededOnSubscription
protected boolean isConsumersExceededOnSubscription()Description copied from class:AbstractBaseDispatcherDetermine whether the number of consumers on the subscription reaches the threshold.- Specified by:
isConsumersExceededOnSubscriptionin classAbstractBaseDispatcher- Returns:
-
removeConsumer
- Specified by:
removeConsumerin interfaceDispatcher- Throws:
BrokerServiceException
-
isConsumerConnected
public boolean isConsumerConnected()- Specified by:
isConsumerConnectedin interfaceDispatcher- Overrides:
isConsumerConnectedin classAbstractDispatcherMultipleConsumers
-
getConsumers
- Specified by:
getConsumersin interfaceDispatcher- Overrides:
getConsumersin classAbstractDispatcherMultipleConsumers
-
canUnsubscribe
- Specified by:
canUnsubscribein interfaceDispatcher- Overrides:
canUnsubscribein classAbstractDispatcherMultipleConsumers
-
close
Description copied from interface:Dispatchermark dispatcher closed to stop new incoming requests and disconnect all consumers.- Specified by:
closein interfaceDispatcher- Returns:
-
consumerFlow
Description copied from interface:DispatcherIndicates that this consumer is now ready to receive more messages.- Specified by:
consumerFlowin interfaceDispatcher
-
disconnectAllConsumers
Description copied from interface:Dispatcherdisconnect all consumers.- Specified by:
disconnectAllConsumersin interfaceDispatcher- Returns:
-
disconnectActiveConsumers
Description copied from interface:DispatcherDisconnect active consumers.- Specified by:
disconnectActiveConsumersin interfaceDispatcher
-
resetCloseFuture
public void resetCloseFuture()- Specified by:
resetCloseFuturein interfaceDispatcher- Overrides:
resetCloseFuturein classAbstractBaseDispatcher
-
reset
public void reset()Description copied from interface:Dispatchermark dispatcher open to serve new incoming requests.- Specified by:
resetin interfaceDispatcher
-
getType
public org.apache.pulsar.common.api.proto.CommandSubscribe.SubType getType()- Specified by:
getTypein interfaceDispatcher- Overrides:
getTypein classAbstractDispatcherMultipleConsumers
-
getRedeliveryTracker
- Specified by:
getRedeliveryTrackerin interfaceDispatcher
-
sendMessages
- Specified by:
sendMessagesin interfaceNonPersistentDispatcher
-
hasPermits
public boolean hasPermits()- Specified by:
hasPermitsin interfaceNonPersistentDispatcher
-
getMessageDropRate
public org.apache.pulsar.common.stats.Rate getMessageDropRate()- Specified by:
getMessageDropRatein interfaceNonPersistentDispatcher
-
isConsumerAvailable
- Specified by:
isConsumerAvailablein classAbstractDispatcherMultipleConsumers
-
reScheduleRead
protected void reScheduleRead()- Specified by:
reScheduleReadin classAbstractBaseDispatcher
-