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 2021/08/24 21:57:17 UTC

[GitHub] [pulsar] cckellogg commented on a change in pull request #11763: [Pulsar-client] Allow us to easily get a mapping of brokers to partitioned topics

cckellogg commented on a change in pull request #11763:
URL: https://github.com/apache/pulsar/pull/11763#discussion_r695245092



##########
File path: pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
##########
@@ -345,11 +345,18 @@ void run() throws PulsarAdminException {
     private class PartitionedLookup extends CliCommand {
         @Parameter(description = "persistent://tenant/namespace/partitionedTopic", required = true)
         private java.util.List<String> params;
+        @Parameter(names = { "-s",
+                                "--sort-by-broker" }, description = "Sort partitioned-topic by Broker Url")
+        private boolean sortByBroker = false;
 
         @Override
         void run() throws PulsarAdminException {
             String topic = validateTopicName(params);
-            print(getAdmin().lookups().lookupPartitionedTopic(topic));
+            if (sortByBroker) {
+                print(getAdmin().lookups().lookupPartitionedTopicSortByBroker(topic));

Review comment:
       Instead of adding a new method and api can the sorting just be done here or in a helper method in the CmdTopics?




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