michaeljmarshall commented on a change in pull request #13184:
URL: https://github.com/apache/pulsar/pull/13184#discussion_r769861758



##########
File path: 
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java
##########
@@ -146,6 +147,56 @@ public void failed(Throwable throwable) {
         return future;
     }
 
+    @Override
+    public List<BundleStats> getAllBundleStats(String namespace) throws 
PulsarAdminException {
+        return sync(() -> getAllBundleStatsAsync(namespace));
+    }
+
+    @Override
+    public CompletableFuture<List<BundleStats>> getAllBundleStatsAsync(String 
namespace) {
+        NamespaceName ns = NamespaceName.get(namespace);
+        WebTarget path = namespacePath(ns, "bundleStats");
+        final CompletableFuture<List<BundleStats>> future = new 
CompletableFuture<>();
+        asyncGetRequest(path,

Review comment:
       I made a similar point in another comment. Since the admin cli doesn't 
parameterize which broker is targeted, I think this endpoint will lead to 
unexpected results when there is more than one broker. I think this might even 
be true when looking up a singe bundle's stats, unless there is a lookup query 
somewhere that I'm missing.

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -515,6 +516,37 @@ public BundlesData getBundlesData(@PathParam("tenant") 
String tenant,
         return policies.bundles;
     }
 
+    @GET
+    @Path("/{tenant}/{namespace}/bundleStats")
+    @ApiOperation(value = "Get all bundles split data of this namespace.")
+    @ApiResponses(value = {
+            @ApiResponse(code = 307, message = "Current broker doesn't serve 
the namespace"),
+            @ApiResponse(code = 403, message = "Don't have admin permission") 
})
+    public List<BundleStats> getBundleStats(@PathParam("tenant") String tenant,
+                                      @PathParam("namespace") String 
namespace) {
+        validatePoliciesReadOnlyAccess();
+        validateNamespaceName(tenant, namespace);
+        validateNamespaceOperation(NamespaceName.get(tenant, namespace), 
NamespaceOperation.GET_BUNDLE);
+
+        return internalGetAllBundleStats();
+    }
+
+    @GET
+    @Path("/{tenant}/{namespace}/{bundle}/stats")
+    @ApiOperation(value = "Get the bundles split data.")
+    @ApiResponses(value = {
+            @ApiResponse(code = 307, message = "Current broker doesn't serve 
the namespace"),

Review comment:
       What happens if the current broker serves the namespace but doesn't host 
the bundle?




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