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 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh right, I missed that too!

Copy link
Collaborator

Choose a reason for hiding this comment

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

FTR this was fixed in #1995

@jeffwidman jeffwidman merged commit da01fef into dpkp:master Feb 6, 2020
@jeffwidman
Copy link
Collaborator

Thanks again for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants