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 2021/12/07 11:00:20 UTC

[GitHub] [pulsar] leizhiyuan commented on a change in pull request #13164: fix:remove the loadbalance/bundle-data node

leizhiyuan commented on a change in pull request #13164:
URL: https://github.com/apache/pulsar/pull/13164#discussion_r763878473



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/NamespaceResources.java
##########
@@ -296,4 +297,39 @@ public boolean partitionedTopicExists(TopicName tn) throws MetadataStoreExceptio
             return future;
         }
     }
+
+    // clear resource of `/loadbalance/bundle-data/{tenant}/{namespace}/` for zk-node
+    public CompletableFuture<Void> deleteBundleDataAsync(NamespaceName ns) {
+        final String namespaceBundlePath = joinPath(BUNDLE_DATA_BASE_PATH, ns.toString());
+        CompletableFuture<Void> future = new CompletableFuture<Void>();
+        deleteRecursiveAsync(this, namespaceBundlePath).whenComplete((ignore, ex) -> {
+            if (ex != null && ex.getCause() instanceof KeeperException.NoNodeException) {
+                future.complete(null);
+            } else if (ex != null) {
+                future.completeExceptionally(ex);
+            } else {
+                future.complete(null);
+            }
+        });
+
+        return future;
+    }
+
+    // clear resource of `/loadbalance/bundle-data/{tenant}/` for zk-node
+    public CompletableFuture<Void> deleteBundleDataTenantAsync(String tenant) {
+        final String namespaceBundlePath = joinPath(BUNDLE_DATA_BASE_PATH, tenant);

Review comment:
       ok




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