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/21 10:00:57 UTC

[GitHub] [pulsar] HQebupt commented on a diff in pull request #16141: [improve][broker][PIP-149]make getInternalStats method async

HQebupt commented on code in PR #16141:
URL: https://github.com/apache/pulsar/pull/16141#discussion_r902417914


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/NonPersistentTopics.java:
##########
@@ -93,25 +92,32 @@ public void getPartitionedMetadata(
             @ApiResponse(code = 307, message = "Current broker doesn't serve the namespace of this topic"),
             @ApiResponse(code = 403, message = "Don't have admin permission"),
             @ApiResponse(code = 404, message = "Topic does not exist")})
-    public PersistentTopicInternalStats getInternalStats(@PathParam("property") String property,
-                                                         @PathParam("cluster") String cluster, @PathParam("namespace")
-                                                                     String namespace,
-                                                         @PathParam("topic") @Encoded String encodedTopic,
-                                                         @QueryParam("authoritative") @DefaultValue("false")
-                                                                     boolean authoritative,
-                                                         @QueryParam("metadata") @DefaultValue("false")
-                                                                     boolean metadata) {
+    public void getInternalStats(
+            @Suspended final AsyncResponse asyncResponse,
+            @PathParam("property") String property,
+            @PathParam("cluster") String cluster, @PathParam("namespace")
+                    String namespace,
+            @PathParam("topic") @Encoded String encodedTopic,
+            @QueryParam("authoritative") @DefaultValue("false")
+                    boolean authoritative,
+            @QueryParam("metadata") @DefaultValue("false")
+                    boolean metadata) {
         validateTopicName(property, cluster, namespace, encodedTopic);

Review Comment:
   If the `validateTopicName` throws RestException, the method can throw it out.



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