Repository navigation
[BEAM7473] [BEAM8478] Update SDF related APIs - #9794
Conversation
d856017 to
a34b71a
Compare
|
Run Python Precommit |
|
SUCCESS --none-- |
|
Kindly pinged : ) |
robertwb
left a comment
There was a problem hiding this comment.
Thanks. I've left some comments. The least fleshed out seems WatermarkEstimator, but I don't think we have to resolve that before getting the other stuff in.
There was a problem hiding this comment.
While I think it makes sense to allow both in the public API, I generally try to avoid such redundancy in the internal implementation. However, it may be OK in this case given neither is clearly better. Any thoughts @lukecwik ?
There was a problem hiding this comment.
I created a JIRA issue as follow up: BEAM-8536. Maybe it would be better to separate this PR from java changes?
There was a problem hiding this comment.
I wouldn't expose ThreadsafeRestrictionTracker and RestrictionTrackerView as public--users shouldn't be creating these. (One could argue perhaps the latter, for documentation purposes.)
There was a problem hiding this comment.
I would put this note down below "Keeps track of the restrictions claimed part for a Splittable DoFn." as it's not the most important thing about this class.
Also, to be completely clear, I might phrase it as
The restriction may be modified by different threads, however the system will ensure sufficient locking such that no methods on the restriction tracker will be called concurrently.
There was a problem hiding this comment.
Hmm... Looking at this in context it seems out-of-place. I would remove this from RestrctionTracker and suggest the implementation(s) be placed in RestrictionProvider instead.
There was a problem hiding this comment.
Removed default_size from RestrictionTracker in commit: 786fb3c. There is another API called restriction_size() in RestrictionProvider, which is duplicated with default_size.
There was a problem hiding this comment.
I wonder if we should require the user to implement this at all. Perhaps it should just be part of the RestrictionTrackerView, whose implementation is try_split(0), marking self as done, and populating that which needs to be returned for deferred_status.
There was a problem hiding this comment.
The fact that we have to do this seems like a flaw in our API... Can we not get this information out of current_restriction()?
There was a problem hiding this comment.
Should this be set_watermark?
There was a problem hiding this comment.
I think we should flesh out what the interface is for a general WatermarkEstimator, vs. this particular ManualWatermarkEstimator with this particular implementation. This may inform whether we want a WatermarkEstimatorProvider or an actual WatermarkEstimator instance (which we repeatedly call reset() on.) A TODO would be fine.
There was a problem hiding this comment.
Created BEAM-8537. I'll follow up with this one after merging this PR.
|
All above comments have been addressed. I'll merge conflicts once changes look fine. |
|
Run Portable_Python PreCommit |
robertwb
left a comment
There was a problem hiding this comment.
Just some more references to default_size to remove, then it looks good.
There was a problem hiding this comment.
We should remove its use as well.
There was a problem hiding this comment.
Move up to the restriction provider(s).
|
Run Python PreCommit |
|
Kindly pinged : D |
robertwb
left a comment
There was a problem hiding this comment.
Looks like there's some merge conflicts, but other than that looks good to me. Thanks.
|
Run Python PreCommit |
|
Run Java PreCommit |
|
Run Python PreCommit |
|
Run Python PreCommit |
|
fyi @rohdesamuel |
API changes included:
Create WatermarkEstimator for tracking watermark.
Use try_split(0) as checkpoint and delete checkpoint API.
Create ThreadsafeRestrictionTracker which wraps a RestrictionTracker to provide synchronization.
Create RestrictionTrackerView to limit API expose to a DoFn.
OffsetRestrictionTracker changes:
Clean up lock logic
Clean up checkpoint()
Proto changes:
R: @robertwb
cc: @lukecwik