Skip to content

Conversation

@mutianf
Copy link
Contributor

@mutianf mutianf commented Dec 8, 2023

Optimize the segement reader so we're actually fetching more rows when the buffer size is low.

future in segment reader is only reset to null in waitReadRowsFuture() method. This means that on the 2nd page of the read, we set the future to fetchNextSegment(); (line 343), but we never checks if the future is resolved until the buffer is empty (line 345). Adding the check on line 334 will make sure we move the results to the buffer and reset future to null. So next time when the buffer size is small we send the request for the next page.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @damondouglas for label java.
R: @damondouglas for label io.
R: @igorbernstein2 for label bigtable.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@mutianf mutianf changed the title fix: optimize segemant reader fix: optimize segment reader Dec 12, 2023
Copy link
Contributor

@damondouglas damondouglas left a comment

Choose a reason for hiding this comment

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

LGTM

@damondouglas damondouglas merged commit 8be85d2 into apache:master Dec 13, 2023
@mutianf mutianf deleted the optimize branch December 13, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants