You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/28 02:06:44 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #15347: [cleanup][broker] Remove duplicate code to improve delete subscription

codelipenghui commented on code in PR #15347:
URL: https://github.com/apache/pulsar/pull/15347#discussion_r860391215


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -1452,216 +1452,93 @@ protected void internalGetPartitionedStatsInternal(AsyncResponse asyncResponse,
         });
     }
 
-    protected void internalDeleteSubscription(AsyncResponse asyncResponse,
-                                              String subName, boolean authoritative, boolean force) {
-        if (force) {
-            internalDeleteSubscriptionForcefully(asyncResponse, subName, authoritative);
-        } else {
-            internalDeleteSubscription(asyncResponse, subName, authoritative);
-        }
-    }
-
-    protected void internalDeleteSubscription(AsyncResponse asyncResponse, String subName, boolean authoritative) {
+    protected void internalDeleteSubscriptionAsync(AsyncResponse asyncResponse, String subName, boolean authoritative,

Review Comment:
   It's better to avoid passing the AsyncResponse into the implementation method because it's hard to know the return type from the API.
   
   Instead, return CompletableFuture for this method.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org