BewareMyPower commented on code in PR #21745:
URL: https://github.com/apache/pulsar/pull/21745#discussion_r1437006985


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1231,37 +1232,56 @@ private void 
asyncDeleteCursorWithClearDelayedMessage(String subscriptionName,
             if (ex != null) {
                 unsubscribeFuture.completeExceptionally(ex);
             } else {
-                asyncDeleteCursor(subscriptionName, unsubscribeFuture);
+                asyncDeleteCursor(persistentSubscription, unsubscribeFuture);
             }
         });
     }
 
-    private void asyncDeleteCursor(String subscriptionName, 
CompletableFuture<Void> unsubscribeFuture) {

Review Comment:
   To avoid so many code changes due to a pre-processing, you can add an 
override like:
   
   ```java
       private void asyncDeleteCursor(PersistentSubscription subscription, 
CompletableFuture<Void> unsubscribeFuture) {
           final var subscriptionName = subscription.getName();
           if (!isCompactionSubscription(subscriptionName) || !(subscription 
instanceof PulsarCompactorSubscription)) {
               asyncDeleteCursor(subscriptionName, unsubscribeFuture);
               return;
           }
           ((PulsarCompactorSubscription) subscription).cleanCompactedLedger()
                   /* ... */
                   .thenAccept(__ -> asyncDeleteCursor(subscriptionName, 
unsubscribeFuture));
       }
   ```



-- 
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