public abstract class AbstractBaseDispatcher extends Object implements Dispatcher
| Modifier and Type | Field and Description |
|---|---|
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) |
void |
filterEntriesForConsumer(List<Entry> entries,
EntryBatchSizes batchSizes,
SendMessageInfo sendMessageInfo,
EntryBatchIndexesAcks indexesAcks,
ManagedCursor cursor,
boolean isReplayRead)
Filter messages that are being sent to a consumers.
|
void |
filterEntriesForConsumer(Optional<EntryWrapper[]> entryWrapper,
int entryWrapperOffset,
List<Entry> entries,
EntryBatchSizes batchSizes,
SendMessageInfo sendMessageInfo,
EntryBatchIndexesAcks indexesAcks,
ManagedCursor cursor,
boolean isReplayRead) |
protected abstract boolean |
isConsumersExceededOnSubscription()
Determine whether the number of consumers on the subscription reaches the threshold.
|
protected boolean |
isConsumersExceededOnSubscription(BrokerService brokerService,
String topic,
int consumerSize) |
protected byte[] |
peekStickyKey(io.netty.buffer.ByteBuf metadataAndPayload) |
void |
resetCloseFuture() |
protected int |
updateEntryWrapperWithMetadata(EntryWrapper[] entryWrappers,
List<Entry> entries)
Update Entries with the metadata of each entry.
|
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 AbstractBaseDispatcher(Subscription subscription, ServiceConfiguration serviceConfig)
protected int updateEntryWrapperWithMetadata(EntryWrapper[] entryWrappers, List<Entry> entries)
entries - public void filterEntriesForConsumer(List<Entry> entries, EntryBatchSizes batchSizes, SendMessageInfo sendMessageInfo, EntryBatchIndexesAcks indexesAcks, ManagedCursor cursor, boolean isReplayRead)
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 void filterEntriesForConsumer(Optional<EntryWrapper[]> entryWrapper, int entryWrapperOffset, List<Entry> entries, EntryBatchSizes batchSizes, SendMessageInfo sendMessageInfo, EntryBatchIndexesAcks indexesAcks, ManagedCursor cursor, boolean isReplayRead)
protected abstract boolean isConsumersExceededOnSubscription()
protected boolean isConsumersExceededOnSubscription(BrokerService brokerService, String topic, int consumerSize)
public void resetCloseFuture()
resetCloseFuture in interface Dispatcherprotected 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.