Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[BEAM-10212] Add caching state client wrapper #15170
[BEAM-10212] Add caching state client wrapper #15170
Changes from all commits
a49606b
520ed93
e6ab75f
ff8b04f
ed3ea2a
bb74e51
017d3d3
734d6bb
72dd967
c9ec8b6
32a0881
cd72ce4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem like we are using the Loading part of LoadingCache, did you mean to have the CachingBeamFnStateClient perform the loading?
This would generally be a good thing since requests that go for the same state key could resolve down to a single request to the runner instead of multiple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this for a future PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: how is the GET served when cache miss? When cache hits, you have
response.complete
, do you need the same for cache miss after you put the state into the cache?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response.complete is executed by the beamFnStateClient.handle call here, but if it is a cache hit we can complete the response immediately so we do not need to forward the request to the delegate state client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then can you confirm that after complete, your thenAccept will still be executed? (I am not a async API expert so I am not sure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments please. Note: every class, public method, and tricky bits of code should have comments. There are some exceptions of course, like
getters/setters
or trivial self explanatory methods.If you're curious about learning more, you can refer to Google's public style guide for some good practices: https://google.github.io/styleguide/javaguide.html