heesung-sn commented on code in PR #23892:
URL: https://github.com/apache/pulsar/pull/23892#discussion_r1929316644


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -632,7 +632,7 @@ public void operationComplete(List<String> consumers, Stat 
s) {
                     for (final String cursorName : consumers) {
                         log.info("[{}] Loading cursor {}", name, cursorName);
                         final ManagedCursorImpl cursor;
-                        cursor = new ManagedCursorImpl(bookKeeper, 
ManagedLedgerImpl.this, cursorName);
+                        cursor = 
createCursor(ManagedLedgerImpl.this.bookKeeper, cursorName);

Review Comment:
   nit: bookKeper



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -663,7 +663,7 @@ public void operationFailed(ManagedLedgerException 
exception) {
                             log.debug("[{}] Recovering cursor {} lazily", 
name, cursorName);
                         }
                         final ManagedCursorImpl cursor;
-                        cursor = new ManagedCursorImpl(bookKeeper, 
ManagedLedgerImpl.this, cursorName);
+                        cursor = 
createCursor(ManagedLedgerImpl.this.bookKeeper, cursorName);

Review Comment:
   nit: bookKeper



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:
##########
@@ -327,6 +267,79 @@ private CompletableFuture<Void> 
addConsumerInternal(Consumer consumer) {
         });
     }
 
+    /**
+     * Create a new dispatcher or reuse the existing one when it's compatible 
with the new consumer.
+     * This protected method can be overridded for testing purpose for 
injecting test dispatcher instances with
+     * special behaviors.
+     * @param dispatcher the existing dispatcher
+     * @param consumer the new consumer
+     * @return the dispatcher to use, either the existing one or a new one
+     */
+    protected Dispatcher reuseOrCreateDispatcher(Dispatcher dispatcher, 
Consumer consumer) {

Review Comment:
   nit: getOrCreateDispatcher



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to