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


##########
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:
   Better to invoke `validateTopicName` like this. Otherwise if validate topic 
name failure, `resumeAsyncResponseExceptionally` will not be invoked.
   ```
    CompletableFuture.completedFuture(null)
               .thenRun(() -> validateTopicName(tenant, namespace, 
encodedTopic))
               .thenCompose(() -> validateTopicOwnershipAsync(topicName, 
authoritative))
               ....
   ```



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/NonPersistentTopics.java:
##########
@@ -93,25 +93,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")

Review Comment:
   I think it'better to remain line98-104  unchanged.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to