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/06/30 12:39:14 UTC

[GitHub] [pulsar] gaozhangmin commented on a diff in pull request #16292: [improve][standalone]Remove check if default namespace exists

gaozhangmin commented on code in PR #16292:
URL: https://github.com/apache/pulsar/pull/16292#discussion_r910976724


##########
pulsar-broker/src/main/java/org/apache/pulsar/zookeeper/LocalBookkeeperEnsemble.java:
##########
@@ -369,21 +369,16 @@ public void runStreamStorage(CompositeConfiguration conf) throws Exception {
                  .build())
             .buildAdmin()) {
 
+            LOG.info("Creating default namespace");
             try {
-                NamespaceProperties ns = FutureUtils.result(admin.getNamespace("default"));

Review Comment:
   It was throw by 
   ```
   private void processGetNamespaceResponse(String namespace,
                                                GetNamespaceResponse response,
                                                CompletableFuture<NamespaceProperties> getFuture) {
           StatusCode code = response.getCode();
           if (StatusCode.SUCCESS == code) {
               getFuture.complete(response.getNsProps());
               return;
           }
           getFuture.completeExceptionally(createRootRangeException(namespace, code));
       }
   ```



##########
pulsar-broker/src/main/java/org/apache/pulsar/zookeeper/LocalBookkeeperEnsemble.java:
##########
@@ -369,21 +369,16 @@ public void runStreamStorage(CompositeConfiguration conf) throws Exception {
                  .build())
             .buildAdmin()) {
 
+            LOG.info("Creating default namespace");
             try {
-                NamespaceProperties ns = FutureUtils.result(admin.getNamespace("default"));

Review Comment:
   It was throw by  createRootRangeException
   ```
   private void processGetNamespaceResponse(String namespace,
                                                GetNamespaceResponse response,
                                                CompletableFuture<NamespaceProperties> getFuture) {
           StatusCode code = response.getCode();
           if (StatusCode.SUCCESS == code) {
               getFuture.complete(response.getNsProps());
               return;
           }
           getFuture.completeExceptionally(createRootRangeException(namespace, code));
       }
   ```



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