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/02/14 01:21:32 UTC

[GitHub] [pulsar] Shoothzj commented on a change in pull request #14258: [Management] Optimize ``BrokerBase`` log.

Shoothzj commented on a change in pull request #14258:
URL: https://github.com/apache/pulsar/pull/14258#discussion_r805449823



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -851,4 +851,17 @@ protected void validatePersistencePolicies(PersistencePolicies persistence) {
                         persistence.getBookkeeperAckQuorum()));
 
     }
-}
+
+    /**
+     * Check current exception whether is redirect exception.
+     *
+     * @param ex The throwable.
+     * @return Whether is redirect exception
+     */
+     protected static boolean isRedirectException(Throwable ex) {
+        Throwable realCause = FutureUtil.unwrapCompletionException(ex);
+        return realCause instanceof WebApplicationException
+                && ((WebApplicationException) realCause).getResponse().getStatus()
+                        == Status.TEMPORARY_REDIRECT.getStatusCode();
+    }
+}

Review comment:
       better have a new line on the end
   ```suggestion
   }
   
   ```




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