Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pulsar-broker] support to get list of topics under a namespace bundle #12632

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

rdhabalia
Copy link
Contributor

Motivation

Right now, broker-admin api allows user to get list of topics under a namespace but sometime user also needs a list of topics under a given namespace bundle. so, add support to fetch list of topics under a namespace

Modificaiton

  • add pulsar-admin REST and CLI API to get list of topics under a namespace

Result

./pulsar-admin topics list sample/ns1 --bundle 0xc0000000_0xffffffff   
persistent://sample/ns1/t1

@github-actions
Copy link

github-actions bot commented Nov 4, 2021

@rdhabalia:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@Anonymitaet Anonymitaet added doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. and removed doc-label-missing labels Nov 5, 2021
@Anonymitaet
Copy link
Member

@rdhabalia do we need to add docs here?

* @throws PulsarAdminException
* Unexpected error
*/
List<String> getList(String namespace, String bundle, TopicDomain topicDomain) throws PulsarAdminException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggests to provide the corresponding getListAsync method like the others?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about introducing a GetListOption? we might want to add more params in the future, this will make the API looks very bloated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added getListAsync with param map for future extension.

@@ -889,7 +889,7 @@ public void topics() throws Exception {
verify(mockTopics).revokePermissions("persistent://myprop/clust/ns1/ds1", "admin");

cmdTopics.run(split("list myprop/clust/ns1"));
verify(mockTopics).getList("myprop/clust/ns1", null);
verify(mockTopics).getList("myprop/clust/ns1", null, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to keep the previous code line as the interface is not removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not removing the code but CLI admin list command now uses the new interface which this test is validating.

* @throws PulsarAdminException
* Unexpected error
*/
List<String> getList(String namespace, TopicDomain topicDomain, Map<String, Object> params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, It's a little confusing to add params here. It's easy for coding, but not so easy for user to understand how to use this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, added an enum to use query param for usability.

@rdhabalia rdhabalia force-pushed the list_bundle branch 3 times, most recently from 3e08154 to 6867253 Compare November 9, 2021 23:18
@rdhabalia
Copy link
Contributor Author

@eolivelli @Jason918 PTAL.

@rdhabalia
Copy link
Contributor Author

ping

@rdhabalia
Copy link
Contributor Author

this PR again has conflicts. can we please review and merge the PR.

@codelipenghui
Copy link
Contributor

@Jason918 Please help review the PR again.

@codelipenghui
Copy link
Contributor

@rdhabalia Please help resolve the conflicts so that we can merge this PR.

@codelipenghui
Copy link
Contributor

@Jason918 I have resolved the conflicts, please review again.

@Jason918
Copy link
Contributor

/pulsarbot run-failure-checks

Copy link
Contributor

@hangc0276 hangc0276 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@Jason918
Copy link
Contributor

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

@rdhabalia Could you please help check the failed test? Looks like related to this PR.

@rdhabalia rdhabalia merged commit edf4858 into apache:master Feb 10, 2022
@rdhabalia rdhabalia deleted the list_bundle branch February 10, 2022 08:36
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants