lukecwik commented on a change in pull request #11418: [BEAM-8872] Support
split at fraction for OffsetRangeTracker
URL: https://github.com/apache/beam/pull/11418#discussion_r408473046
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/splittabledofn/OffsetRangeTracker.java
##########
@@ -49,13 +50,22 @@ public OffsetRange currentRestriction() {
@Override
public SplitResult<OffsetRange> trySplit(double fractionOfRemainder) {
- // TODO(BEAM-8872): Add support for splitting off a fixed amount of work
for this restriction
- // instead of only supporting checkpointing.
-
- checkState(
- lastClaimedOffset != null, "Can't checkpoint before any offset was
successfully claimed");
- OffsetRange res = new OffsetRange(lastClaimedOffset + 1, range.getTo());
- this.range = new OffsetRange(range.getFrom(), lastClaimedOffset + 1);
+ checkState(lastClaimedOffset != null, "Can't split before any offset was
successfully claimed");
Review comment:
We can split before any successfully claimed block by returning `[from, to)`
and updating the current range to be `[from, from)`
This makes sense in some cases where we want to handoff all the work to
someone else for the active element while this Bundle finishes other processing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services