Skip to content

KAFKA-14960: [Part I]TopicMetadataRequestManager Implementation#7

Merged
kirktrue merged 6 commits into
ctr-stagingfrom
consumer-refactor-metadata-request-manager
Jun 8, 2023
Merged

KAFKA-14960: [Part I]TopicMetadataRequestManager Implementation#7
kirktrue merged 6 commits into
ctr-stagingfrom
consumer-refactor-metadata-request-manager

Conversation

@philipnee

Copy link
Copy Markdown
Owner

This is the implementation of the TopicMetadataRequestManager, responsible for handling topic metadata from partitionsFor and listTopics

The PR also refactors the current callback mechanism because I think the usage is rather inorganic. Now, user can pass in a BiConsumer to be triggered when the request is completed.

@kirktrue @lianetm

@philipnee
philipnee force-pushed the consumer-refactor-metadata-request-manager branch from b7f2814 to eef8a9f Compare May 10, 2023 18:27

@kirktrue kirktrue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd like to see how this plugs into the background thread and application event processor, specifically how it handles ensuring that duplicate API calls are handled appropriately.

Also, can we refactor TopicMetadataRequestManager and TopicMetadataFetcher so that they use the same core response handling logic?

@philipnee
philipnee force-pushed the consumer-refactor-metadata-request-manager branch from 8ae018e to 8616b93 Compare May 11, 2023 20:14
@philipnee

Copy link
Copy Markdown
Owner Author

Thanks for the review - @kirktrue @lianetm Addressed the comments

@philipnee

Copy link
Copy Markdown
Owner Author

I think I ommitted kirk's comments: Working on them ...

@philipnee
philipnee force-pushed the consumer-refactor-metadata-request-manager branch from 8616b93 to 03ff808 Compare May 12, 2023 20:11
@philipnee

Copy link
Copy Markdown
Owner Author

@kirktrue @lianetm - I added some code around how ApplicationEventProcessor hook up with the request manager. The second PR will cover how it hook up with the client thread/API.

@kirktrue kirktrue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think I'm getting lost with all of the futures and callbacks. I feel we may want to do some restructuring, renaming, or documenting to keep things straight.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add some JavaDoc? I'm not totally sure when to use this class vs. using the future from the UnsentRequest.

fix broken test

Add tests and fix response handler

cleaned up and addressed some of the comments from the PR

wip

wip

Testing the impl

Added tests

MetadataRequestManager and refactor the callbacks

Update MetadataRequestManager.java

Create MetadataRequestManager.java
@philipnee
philipnee force-pushed the consumer-refactor-metadata-request-manager branch from 90ed7de to f09fd9a Compare June 1, 2023 17:43
@philipnee
philipnee requested review from kirktrue and lianetm June 1, 2023 18:05
@philipnee

Copy link
Copy Markdown
Owner Author

@kirktrue thanks for the review! Ready for another pass. Think I addressed your comments.

@kirktrue
kirktrue merged commit 53ac65b into ctr-staging Jun 8, 2023
philipnee added a commit that referenced this pull request Jun 9, 2023
TopicMetadataRequestManager implementation

---------

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>
kirktrue added a commit that referenced this pull request Jun 22, 2023
…o new consumer threading refactor

This change introduces the FetchRequestManager that will be responsible for:

- Formatting fetch requests to the background thread
- Configuring the callback on fetch responses for the background thread

The response handler will collect the fetch responses from the broker and create CompletedFetch instances as is done in Fetcher. The foreground logic will decompress the data into a Record, which will then be deserialized into a ConsumerRecord for returning to the user.
philipnee added a commit that referenced this pull request Jul 19, 2023
TopicMetadataRequestManager implementation

---------

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>
philipnee added a commit that referenced this pull request Sep 11, 2023
TopicMetadataRequestManager implementation

---------

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>
philipnee added a commit that referenced this pull request Sep 11, 2023
TopicMetadataRequestManager implementation

---------

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>
philipnee added a commit that referenced this pull request Sep 13, 2023
TopicMetadataRequestManager implementation

---------

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>
philipnee added a commit that referenced this pull request Sep 13, 2023
TopicMetadataRequestManager implementation

---------

Co-authored-by: Lianet Magrans <lmagrans@confluent.io>
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.

3 participants