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

Implement list_topics, describe_topics, and describe_cluster #1993

Merged
merged 1 commit into from Feb 6, 2020

Conversation

@TylerLubeck
Copy link
Contributor

TylerLubeck commented Feb 6, 2020

This is just #1956 but with a clean commit history


This change is Reviewable

@TylerLubeck TylerLubeck mentioned this pull request Feb 6, 2020
def describe_cluster(self):
metadata = self._get_cluster_metadata()
obj = metadata.to_object()
obj.pop('topics') # We have 'describe_topics' for this

This comment has been minimized.

Copy link
@jeffwidman

jeffwidman Feb 6, 2020

Collaborator

Does the Java client include or exclude the topics as part of the cluster metadata call?

I know it seems redundant but dropping them here forces the caller to issue two API calls to the Kafka broker if they want both... not ideal for monitoring scripts that may run frequently. Although I suppose if someone really cares they can call _get_cluster_metadata() directly.

But really I just think we should follow the Java client here, so if they drop the topics, then we should too...

This comment has been minimized.

Copy link
@TylerLubeck

TylerLubeck Feb 6, 2020

Author Contributor

Yeah, based on their javadoc they exclude topics as part of the metadata call, though it also looks like they avoid fetching the topics at all.

It's easy enough to throw in a def describe_cluster_and_topics if you want to deviate from the java client a bit?

This comment has been minimized.

Copy link
@jeffwidman

jeffwidman Feb 6, 2020

Collaborator

Let's leave as-is if it follows Java, that will be good enough for now and anyone who wants the speed boost can live dangerously with _get_cluster_metadata().

Also, my reading of that Java code is they're passing an empty list for the topics, which maps to fetching all topics... but I could be wrong it's been over a year since I looked at the Metadata protocol definition.

This comment has been minimized.

Copy link
@TylerLubeck

TylerLubeck Feb 6, 2020

Author Contributor

It's been a bit for myself as well, I'm testing it now. I also just noticed that I had missed the "use controller for describe topics" comment, I'm adding that now

This comment has been minimized.

Copy link
@jeffwidman

jeffwidman Feb 6, 2020

Collaborator

Oh right, I missed that too!

This comment has been minimized.

Copy link
@jeffwidman

jeffwidman Feb 16, 2020

Collaborator

FTR this was fixed in #1995

@jeffwidman jeffwidman merged commit da01fef into dpkp:master Feb 6, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on topics_management_clean at 84.245%
Details
@jeffwidman

This comment has been minimized.

Copy link
Collaborator

jeffwidman commented Feb 6, 2020

Thanks again for this!

@TylerLubeck TylerLubeck deleted the TylerLubeck:topics_management_clean branch Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.