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

More efficient map side inputs for small maps. #29587

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

robertwb
Copy link
Contributor

@robertwb robertwb commented Dec 1, 2023

The ability to perform point lookups for multi-map side inputs is great for maps that are too large to fit into memory, but can be very inefficient in requiring an entire state request per key for small maps.

This change adds an optional protocol to request an entire map as a stream of key-values in one (possibly paginated) API call, and uses this to bulk pre-fetch an initial set of values from the map before falling back to point lookups.


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.

The ability to perform point lookups for multi-map side inputs is great
for maps that are too large to fit into memory, but can be very inefficient
in requiring an entire state request per key for small maps.

This change adds an optional protocol to request an entire map as a stream
of key-values in one (possibly paginated) API call, and uses this to bulk
pre-fetch an initial set of values from the map before falling back to
point lookups.
@robertwb
Copy link
Contributor Author

robertwb commented Dec 1, 2023

R: @priyansndesai

Copy link
Contributor

github-actions bot commented Dec 1, 2023

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@robertwb robertwb force-pushed the small-map-side-input branch from ed05de9 to c299bd1 Compare December 1, 2023 20:55
Copy link
Contributor

@priyansndesai priyansndesai left a comment

Choose a reason for hiding this comment

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

Would we need this for Go?

@robertwb
Copy link
Contributor Author

robertwb commented Dec 7, 2023

Yes, we'll probably want to do that there too. The most important is for Java, but I have Python too because that's where I prototyped it (including the runner side).

@robertwb robertwb merged commit 85bf388 into apache:master Dec 8, 2023
92 checks passed
damccorm added a commit that referenced this pull request Dec 8, 2023
@robertwb
Copy link
Contributor Author

robertwb commented Dec 8, 2023

This is for #29691

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.

2 participants