Class PersistentDispatcherSingleActiveConsumer

    • Field Detail

      • name

        protected final java.lang.String name
      • havePendingRead

        protected volatile boolean havePendingRead
      • readBatchSize

        protected volatile int readBatchSize
      • readFailureBackoff

        protected final org.apache.pulsar.client.impl.Backoff readFailureBackoff
    • Constructor Detail

      • PersistentDispatcherSingleActiveConsumer

        public PersistentDispatcherSingleActiveConsumer​(org.apache.bookkeeper.mledger.ManagedCursor cursor,
                                                        org.apache.pulsar.common.api.proto.CommandSubscribe.SubType subscriptionType,
                                                        int partitionIndex,
                                                        PersistentTopic topic,
                                                        Subscription subscription)
    • Method Detail

      • readEntriesComplete

        public void readEntriesComplete​(java.util.List<org.apache.bookkeeper.mledger.Entry> entries,
                                        java.lang.Object obj)
        Specified by:
        readEntriesComplete in interface org.apache.bookkeeper.mledger.AsyncCallbacks.ReadEntriesCallback
      • internalReadEntriesComplete

        public void internalReadEntriesComplete​(java.util.List<org.apache.bookkeeper.mledger.Entry> entries,
                                                java.lang.Object obj)
      • consumerFlow

        public void consumerFlow​(Consumer consumer,
                                 int additionalNumberOfMessages)
        Description copied from interface: Dispatcher
        Indicates that this consumer is now ready to receive more messages.
        Specified by:
        consumerFlow in interface Dispatcher
      • redeliverUnacknowledgedMessages

        public void redeliverUnacknowledgedMessages​(Consumer consumer,
                                                    java.util.List<org.apache.bookkeeper.mledger.impl.PositionImpl> positions)
        Specified by:
        redeliverUnacknowledgedMessages in interface Dispatcher
      • calculateToRead

        protected org.apache.commons.lang3.tuple.Pair<java.lang.Integer,​java.lang.Long> calculateToRead​(Consumer consumer)
      • readEntriesFailed

        public void readEntriesFailed​(org.apache.bookkeeper.mledger.ManagedLedgerException exception,
                                      java.lang.Object ctx)
        Specified by:
        readEntriesFailed in interface org.apache.bookkeeper.mledger.AsyncCallbacks.ReadEntriesCallback
      • updateRateLimiter

        public void updateRateLimiter​(org.apache.pulsar.common.policies.data.DispatchRate dispatchRate)
        Specified by:
        updateRateLimiter in interface Dispatcher
      • initializeDispatchRateLimiterIfNeeded

        public void initializeDispatchRateLimiterIfNeeded​(java.util.Optional<org.apache.pulsar.common.policies.data.Policies> policies)
        Specified by:
        initializeDispatchRateLimiterIfNeeded in interface Dispatcher
      • checkAndUnblockIfStuck

        public boolean checkAndUnblockIfStuck()
        Description copied from interface: Dispatcher
        Checks if dispatcher is stuck and unblocks the dispatch if needed.
        Specified by:
        checkAndUnblockIfStuck in interface Dispatcher