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

kafka.(*readBuffer) #325

Closed
wants to merge 19 commits into from
Closed

kafka.(*readBuffer) #325

wants to merge 19 commits into from

Conversation

achille-roussel
Copy link
Contributor

This PR refactors the kafka-go read paths to use a new readBuffer type (similar to what we introduced in #318).

This new model reduces the amount of error handling and byte counting that was proliferating all over the place, making the code more robust and easier to read. It also pave the road towards removing the intermediary buffer used when decompressing record batches, and brings us one step closer to being able to offer a zero-copy API for consumers.

I also took some time to cleanup a lot of tests, remove code duplication, and hopefully fix a couple of bugs on the way by reducing the amount of special assumptions that are made between different layers of the codebase.

@achille-roussel
Copy link
Contributor Author

achille-roussel commented Oct 8, 2019

@stevevls if you want to take a second look at this, I think it should be ready to go. Besides the main change which is the introduction of the readBuffer abstraction, the PR addresses a race condition in kafka.Reader which showed up in one of the tests.

@achille-roussel
Copy link
Contributor Author

Closing in favor of #438

@achille-roussel achille-roussel deleted the read-buffer branch June 15, 2020 17:20
@achille-roussel achille-roussel restored the read-buffer branch June 16, 2020 02:13
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