Lakshmi-Balu commented on a change in pull request #11763:
URL: https://github.com/apache/pulsar/pull/11763#discussion_r703786991
##########
File path:
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
##########
@@ -345,12 +349,30 @@ 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(lookupPartitionedTopicSortByBroker(topic));
+ } else {
+ print(getAdmin().lookups().lookupPartitionedTopic(topic));
+ }
+ }
+ }
+
+ private Map<String, List<String>>
lookupPartitionedTopicSortByBroker(String topic) throws PulsarAdminException {
+ Map<String, String> partitionLookup =
getAdmin().lookups().lookupPartitionedTopic(topic);
+ Map<String, List<String>> result = new LinkedHashMap<>();
Review comment:
No specific reason Jerry! Fixed it.
--
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]