public abstract class AbstractBaseDispatcher extends Object implements Dispatcher
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dispatchThrottlingOnBatchMessageEnabled |
protected com.google.common.collect.ImmutableList<EntryFilterWithClassLoader> |
entryFilters
Entry filters in Broker.
|
protected FilterContext |
filterContext |
protected ServiceConfiguration |
serviceConfig |
protected Subscription |
subscription |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBaseDispatcher(Subscription subscription,
ServiceConfiguration serviceConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected static org.apache.commons.lang3.tuple.Pair<Integer,Long> |
computeReadLimits(int messagesToRead,
int availablePermitsOnMsg,
long bytesToRead,
long availablePermitsOnByte) |
int |
filterEntriesForConsumer(List<Entry> entries,
EntryBatchSizes batchSizes,
SendMessageInfo sendMessageInfo,
EntryBatchIndexesAcks indexesAcks,
ManagedCursor cursor,
boolean isReplayRead,
Consumer consumer)
Filter messages that are being sent to a consumers.
|
int |
filterEntriesForConsumer(Optional<EntryWrapper[]> entryWrapper,
int entryWrapperOffset,
List<Entry> entries,
EntryBatchSizes batchSizes,
SendMessageInfo sendMessageInfo,
EntryBatchIndexesAcks indexesAcks,
ManagedCursor cursor,
boolean isReplayRead,
Consumer consumer) |
protected abstract boolean |
isConsumersExceededOnSubscription()
Determine whether the number of consumers on the subscription reaches the threshold.
|
protected boolean |
isConsumersExceededOnSubscription(AbstractTopic topic,
int consumerSize) |
protected byte[] |
peekStickyKey(io.netty.buffer.ByteBuf metadataAndPayload) |
protected boolean |
reachDispatchRateLimit(DispatchRateLimiter dispatchRateLimiter) |
protected abstract void |
reScheduleRead() |
void |
resetCloseFuture() |
protected int |
updateEntryWrapperWithMetadata(EntryWrapper[] entryWrappers,
List<Entry> entries)
Update Entries with the metadata of each entry.
|
protected org.apache.commons.lang3.tuple.Pair<Integer,Long> |
updateMessagesToRead(DispatchRateLimiter dispatchRateLimiter,
int messagesToRead,
long bytesToRead) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConsumer, addUnAckedMessages, canUnsubscribe, checkAndUnblockIfStuck, clearDelayedMessages, close, consumerFlow, cursorIsReset, disconnectActiveConsumers, disconnectAllConsumers, disconnectAllConsumers, getConsumers, getNumberOfDelayedMessages, getRateLimiter, getRedeliveryTracker, getType, initializeDispatchRateLimiterIfNeeded, isClosed, isConsumerConnected, markDeletePositionMoveForward, redeliverUnacknowledgedMessages, redeliverUnacknowledgedMessages, removeConsumer, reset, trackDelayedDelivery, updateRateLimiterprotected final Subscription subscription
protected final ServiceConfiguration serviceConfig
protected final boolean dispatchThrottlingOnBatchMessageEnabled
protected com.google.common.collect.ImmutableList<EntryFilterWithClassLoader> entryFilters
protected final FilterContext filterContext
protected AbstractBaseDispatcher(Subscription subscription, ServiceConfiguration serviceConfig)
protected int updateEntryWrapperWithMetadata(EntryWrapper[] entryWrappers, List<Entry> entries)
entries - public int filterEntriesForConsumer(List<Entry> entries, EntryBatchSizes batchSizes, SendMessageInfo sendMessageInfo, EntryBatchIndexesAcks indexesAcks, ManagedCursor cursor, boolean isReplayRead, Consumer consumer)
Messages can be filtered out for multiple reasons:
entries - a list of entries as read from storagebatchSizes - an array where the batch size for each entry (the number of messages within an entry) is stored. This
array needs to be of at least the same size as the entries listsendMessageInfo - an object where the total size in messages and bytes will be returned back to the callerpublic int filterEntriesForConsumer(Optional<EntryWrapper[]> entryWrapper, int entryWrapperOffset, List<Entry> entries, EntryBatchSizes batchSizes, SendMessageInfo sendMessageInfo, EntryBatchIndexesAcks indexesAcks, ManagedCursor cursor, boolean isReplayRead, Consumer consumer)
protected abstract boolean isConsumersExceededOnSubscription()
protected boolean isConsumersExceededOnSubscription(AbstractTopic topic, int consumerSize)
public void resetCloseFuture()
resetCloseFuture in interface Dispatcherprotected abstract void reScheduleRead()
protected boolean reachDispatchRateLimit(DispatchRateLimiter dispatchRateLimiter)
protected org.apache.commons.lang3.tuple.Pair<Integer,Long> updateMessagesToRead(DispatchRateLimiter dispatchRateLimiter, int messagesToRead, long bytesToRead)
protected static org.apache.commons.lang3.tuple.Pair<Integer,Long> computeReadLimits(int messagesToRead, int availablePermitsOnMsg, long bytesToRead, long availablePermitsOnByte)
protected byte[] peekStickyKey(io.netty.buffer.ByteBuf metadataAndPayload)
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.