wolfstudy commented on a change in pull request #12711:
URL: https://github.com/apache/pulsar/pull/12711#discussion_r749980874



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/NamespaceResources.java
##########
@@ -215,12 +258,27 @@ public boolean partitionedTopicExists(TopicName tn) 
throws MetadataStoreExceptio
                     tn.getEncodedLocalName()));
         }
 
-        public void clearPartitionedTopicMetadata(NamespaceName namespaceName) 
throws MetadataStoreException {
+        public CompletableFuture<Void> 
clearPartitionedTopicMetadataAsync(NamespaceName namespaceName) {
             final String globalPartitionedPath = 
joinPath(PARTITIONED_TOPIC_PATH, namespaceName.toString());
-            // check whether partitioned topics metadata node exist
-            if (exists(globalPartitionedPath)) {
-                deleteRecursive(this, globalPartitionedPath);
-            }
+
+            CompletableFuture<Void> completableFuture = new 
CompletableFuture<>();
+
+            deleteRecursiveAsync(this, globalPartitionedPath)
+                    .thenAccept(ignore -> {
+                        log.info("Clear partitioned topic metadata [{}] 
success.", namespaceName);
+                        completableFuture.complete(null);
+                    }).exceptionally(ex -> {
+                if (ex.getCause().getCause() instanceof KeeperException) {

Review comment:
       ok, will fix this




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