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-7739] Implement ReadModifyWriteState in Python SDK #9067
[BEAM-7739] Implement ReadModifyWriteState in Python SDK #9067
Conversation
Thanks for looking at this. IIRC, the consensus last time this came up was to call it ReadModifyWriteState. |
@robertwb Can you give me more context to that discussion or email chain that I can follow. If |
To follow up on this, it's not yet implemented but that would be a welcome contribution (likely just some renaming in this PR). |
@robertwb can you confirm that we also need to introduce ReadModifyWriteState in the proto definition? beam/model/pipeline/src/main/proto/beam_runner_api.proto Lines 412 to 425 in d510c2b
|
Or simply rename ValueStateSpec in the proto. (These protos are still in a state they can be modified.) |
I just want to make sure I understand it correctly, In case I rename this, I also need to rename in Java SDK as well because it is used there as well, right? I will rename the spec to be consistent and avoid any confusion in future. Edit:
|
@rakeshcusat I think the name for Java would still be the same (changing the name would be a breaking change). As for the proto, I think you can change it, because it's not externally exposed to users of Beam - it's only meant to be used by Beam itself (in this repository). |
aaadc02
to
fdfd029
Compare
Ping? |
@robertwb I was busy but I will try to finish it this week. |
@robertwb / @pabloem Here is the current status:
|
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.
Thanks. Just some minor thoughts. As for Go, the protos are still manually copied and generated there, so I don't think we have to change anything now.
public static final class InMemoryValue<T> | ||
implements ValueState<T>, InMemoryState<InMemoryValue<T>> { | ||
implements ValueState<T>, InMemoryState<InMemoryValue<T>> { |
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.
Seems like this could be mostly merged with InMemoryReadModifyWrite (possibly requiring a common baseclass).
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.
Actually, I wonder if InMemoryReadModifyWrite was a subclass of InMemoryValue one could get rid of some of the parallel code here (e.g. bindValue vs. bindReadModifyWrite). Haven't pursued this to its conclusion though.
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.
This is a good idea, I need to look more closely and consolidate duplicate code.
@@ -273,14 +280,73 @@ void clearInternal() { | |||
} | |||
|
|||
private class FlinkBroadcastValueState<T> extends AbstractBroadcastState<T> | |||
implements ValueState<T> { | |||
implements ValueState<T> { |
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.
Similarly, perhaps ReadModifyWriteState could extend ValueState?
R: @kennknowles |
@kennknowles and I discuss it offline.
Let me know if you have any concerns with this approach. |
Sound good to me. It'd be less work to swap steps (1) and (2). |
Sounds good. I will do as the suggested way. |
Any update on this? I see #9687, were there other PRs? |
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions. |
This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
ValueState is missing from python sdk though Java sdk has it. In order to have the feature parity we should have this implemented for Python sdk.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.