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/08 02:31:42 UTC

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

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



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/NamespaceResources.java
##########
@@ -296,4 +298,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 && ExceptionUtils.getRootCause(ex) instanceof KeeperException.NoNodeException) {

Review comment:
       It's better to use `org.apache.pulsar.metadata.api.MetadataStoreException.NotFoundException` to replace `KeeperException.NoNodeException`. The underlying metadata store supports multi implementations now.

##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/NamespaceResources.java
##########
@@ -296,4 +298,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 && ExceptionUtils.getRootCause(ex) instanceof KeeperException.NoNodeException) {

Review comment:
       We should use `org.apache.pulsar.metadata.api.MetadataStoreException.NotFoundException` to replace `KeeperException.NoNodeException`. The underlying metadata store supports multi implementations now.
   




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