Class PersistentStreamingDispatcherSingleActiveConsumer
- java.lang.Object
-
- org.apache.pulsar.broker.service.AbstractBaseDispatcher
-
- org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer
-
- org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer
-
- org.apache.pulsar.broker.service.persistent.PersistentStreamingDispatcherSingleActiveConsumer
-
- All Implemented Interfaces:
org.apache.bookkeeper.mledger.AsyncCallbacks.ReadEntriesCallback,Dispatcher,StreamingDispatcher
public class PersistentStreamingDispatcherSingleActiveConsumer extends PersistentDispatcherSingleActiveConsumer implements StreamingDispatcher
APersistentDispatcherSingleActiveConsumerimplementedStreamingDispatcher. It'll useStreamingEntryReaderto read new entries instead read as micro batch from managed ledger.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer
PersistentDispatcherSingleActiveConsumer.ReadEntriesCtx
-
-
Field Summary
-
Fields inherited from class org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer
havePendingRead, name, readBatchSize, readFailureBackoff, topic
-
Fields inherited from class org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer
ACTIVE_CONSUMER_UPDATER, closeFuture, consumers, cursor, FALSE, IS_CLOSED_UPDATER, isFirstRead, isKeyHashRangeFiltered, partitionIndex, stickyKeyConsumerSelector, subscriptionType, topicName, TRUE
-
Fields inherited from class org.apache.pulsar.broker.service.AbstractBaseDispatcher
dispatchThrottlingOnBatchMessageEnabled, entryFilters, filterContext, serviceConfig, subscription
-
-
Constructor Summary
Constructors Constructor Description PersistentStreamingDispatcherSingleActiveConsumer(org.apache.bookkeeper.mledger.ManagedCursor cursor, org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subscriptionType, int partitionIndex, PersistentTopic topic, Subscription subscription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcancelPendingRead()voidcanReadMoreEntries(boolean withBackoff)Notify dispatcher can issue next read request.java.lang.StringgetName()voidinternalReadEntryComplete(org.apache.bookkeeper.mledger.Entry entry, PendingReadEntryRequest ctx)voidnotifyConsumersEndOfTopic()Notify dispatcher to inform consumers reached end of topic.voidreadEntryComplete(org.apache.bookkeeper.mledger.Entry entry, PendingReadEntryRequest ctx)Notify dispatcher issued read entry request has complete.protected voidreadMoreEntries(Consumer consumer)-
Methods inherited from class org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer
addUnAckedMessages, calculateToRead, checkAndUnblockIfStuck, close, consumerFlow, dispatchEntriesToConsumer, getRateLimiter, getRedeliveryTracker, initializeDispatchRateLimiterIfNeeded, internalReadEntriesComplete, isConsumersExceededOnSubscription, readEntriesComplete, readEntriesFailed, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, reScheduleRead, scheduleReadOnActiveConsumer, updateRateLimiter
-
Methods inherited from class org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer
addConsumer, canUnsubscribe, disconnectActiveConsumers, disconnectAllConsumers, getActiveConsumer, getConsumers, getType, isClosed, isConsumerConnected, notifyActiveConsumerChanged, pickAndScheduleActiveConsumer, removeConsumer, reset, resetCloseFuture
-
Methods inherited from class org.apache.pulsar.broker.service.AbstractBaseDispatcher
computeReadLimits, filterEntriesForConsumer, filterEntriesForConsumer, isConsumersExceededOnSubscription, peekStickyKey, reachDispatchRateLimit, updateEntryWrapperWithMetadata, updateMessagesToRead
-
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.broker.service.Dispatcher
addConsumer, addUnAckedMessages, canUnsubscribe, checkAndUnblockIfStuck, clearDelayedMessages, close, consumerFlow, cursorIsReset, disconnectActiveConsumers, disconnectAllConsumers, disconnectAllConsumers, getConsumers, getNumberOfDelayedMessages, getRateLimiter, getRedeliveryTracker, getType, initializeDispatchRateLimiterIfNeeded, isClosed, isConsumerConnected, markDeletePositionMoveForward, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, removeConsumer, reset, resetCloseFuture, trackDelayedDelivery, updateRateLimiter
-
-
-
-
Constructor Detail
-
PersistentStreamingDispatcherSingleActiveConsumer
public PersistentStreamingDispatcherSingleActiveConsumer(org.apache.bookkeeper.mledger.ManagedCursor cursor, org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subscriptionType, int partitionIndex, PersistentTopic topic, Subscription subscription)
-
-
Method Detail
-
canReadMoreEntries
public void canReadMoreEntries(boolean withBackoff)
Notify dispatcher can issue next read request.- Specified by:
canReadMoreEntriesin interfaceStreamingDispatcher
-
cancelPendingRead
protected void cancelPendingRead()
- Overrides:
cancelPendingReadin classPersistentDispatcherSingleActiveConsumer
-
notifyConsumersEndOfTopic
public void notifyConsumersEndOfTopic()
Notify dispatcher to inform consumers reached end of topic.- Specified by:
notifyConsumersEndOfTopicin interfaceStreamingDispatcher
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceStreamingDispatcher- Returns:
- Name of the dispatcher.
-
readEntryComplete
public void readEntryComplete(org.apache.bookkeeper.mledger.Entry entry, PendingReadEntryRequest ctx)Notify dispatcher issued read entry request has complete.- Specified by:
readEntryCompletein interfaceStreamingDispatcher- Parameters:
entry- Entry read.ctx- Context passed in when issuing read entries request.
-
internalReadEntryComplete
public void internalReadEntryComplete(org.apache.bookkeeper.mledger.Entry entry, PendingReadEntryRequest ctx)
-
readMoreEntries
protected void readMoreEntries(Consumer consumer)
- Overrides:
readMoreEntriesin classPersistentDispatcherSingleActiveConsumer
-
-