129
129
import org .apache .pulsar .broker .service .TopicEventsListener .EventStage ;
130
130
import org .apache .pulsar .broker .service .TopicEventsListener .TopicEvent ;
131
131
import org .apache .pulsar .broker .service .nonpersistent .NonPersistentTopic ;
132
+ import org .apache .pulsar .broker .service .persistent .AbstractPersistentDispatcherMultipleConsumers ;
132
133
import org .apache .pulsar .broker .service .persistent .DispatchRateLimiter ;
133
- import org .apache .pulsar .broker .service .persistent .PersistentDispatcherMultipleConsumers ;
134
134
import org .apache .pulsar .broker .service .persistent .PersistentTopic ;
135
135
import org .apache .pulsar .broker .service .persistent .SystemTopic ;
136
136
import org .apache .pulsar .broker .service .plugin .EntryFilterProvider ;
@@ -301,7 +301,7 @@ public class BrokerService implements Closeable {
301
301
private final int maxUnackedMessages ;
302
302
public final int maxUnackedMsgsPerDispatcher ;
303
303
private final AtomicBoolean blockedDispatcherOnHighUnackedMsgs = new AtomicBoolean (false );
304
- private final Set <PersistentDispatcherMultipleConsumers > blockedDispatchers = ConcurrentHashMap .newKeySet ();
304
+ private final Set <AbstractPersistentDispatcherMultipleConsumers > blockedDispatchers = ConcurrentHashMap .newKeySet ();
305
305
private final ReadWriteLock lock = new ReentrantReadWriteLock ();
306
306
@ VisibleForTesting
307
307
private final DelayedDeliveryTrackerFactory delayedDeliveryTrackerFactory ;
@@ -3328,7 +3328,7 @@ public OrderedExecutor getTopicOrderedExecutor() {
3328
3328
* @param dispatcher
3329
3329
* @param numberOfMessages
3330
3330
*/
3331
- public void addUnAckedMessages (PersistentDispatcherMultipleConsumers dispatcher , int numberOfMessages ) {
3331
+ public void addUnAckedMessages (AbstractPersistentDispatcherMultipleConsumers dispatcher , int numberOfMessages ) {
3332
3332
// don't block dispatchers if maxUnackedMessages = 0
3333
3333
if (maxUnackedMessages > 0 ) {
3334
3334
totalUnackedMessages .add (numberOfMessages );
@@ -3387,10 +3387,10 @@ private void blockDispatchersWithLargeUnAckMessages() {
3387
3387
try {
3388
3388
forEachTopic (topic -> {
3389
3389
topic .getSubscriptions ().forEach ((subName , persistentSubscription ) -> {
3390
- if (persistentSubscription .getDispatcher () instanceof PersistentDispatcherMultipleConsumers ) {
3391
- PersistentDispatcherMultipleConsumers dispatcher =
3392
- ( PersistentDispatcherMultipleConsumers ) persistentSubscription
3393
- .getDispatcher ();
3390
+ if (persistentSubscription .getDispatcher ()
3391
+ instanceof AbstractPersistentDispatcherMultipleConsumers ) {
3392
+ AbstractPersistentDispatcherMultipleConsumers dispatcher =
3393
+ ( AbstractPersistentDispatcherMultipleConsumers ) persistentSubscription .getDispatcher ();
3394
3394
int dispatcherUnAckMsgs = dispatcher .getTotalUnackedMessages ();
3395
3395
if (dispatcherUnAckMsgs > maxUnackedMsgsPerDispatcher ) {
3396
3396
log .info ("[{}] Blocking dispatcher due to reached max broker limit {}" ,
@@ -3411,7 +3411,7 @@ private void blockDispatchersWithLargeUnAckMessages() {
3411
3411
*
3412
3412
* @param dispatcherList
3413
3413
*/
3414
- public void unblockDispatchersOnUnAckMessages (List <PersistentDispatcherMultipleConsumers > dispatcherList ) {
3414
+ public void unblockDispatchersOnUnAckMessages (List <AbstractPersistentDispatcherMultipleConsumers > dispatcherList ) {
3415
3415
lock .writeLock ().lock ();
3416
3416
try {
3417
3417
dispatcherList .forEach (dispatcher -> {
0 commit comments