[ 
https://issues.apache.org/jira/browse/BEAM-5974?focusedWorklogId=163298&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-163298
 ]

ASF GitHub Bot logged work on BEAM-5974:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Nov/18 00:55
            Start Date: 07/Nov/18 00:55
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #6949: 
[BEAM-5974] Fix ByteKeyRangeTracker to handle tryClaim(ByteKey.EMPTY) instead 
of exposing markDone
URL: https://github.com/apache/beam/pull/6949#discussion_r231349392
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/splittabledofn/ByteKeyRangeTracker.java
 ##########
 @@ -54,8 +60,25 @@ public synchronized ByteKeyRange currentRestriction() {
 
   @Override
   public synchronized ByteKeyRange checkpoint() {
-    checkState(lastClaimedKey != null, "Can't checkpoint before any key was 
successfully claimed");
-    ByteKey nextKey = next(lastClaimedKey);
+    // If we haven't done any work, we should return the original range we 
were processing
+    // as the checkpoint.
+    if (lastAttemptedKey == null) {
+      ByteKeyRange rval = ByteKeyRange.of(range.getStartKey(), 
range.getEndKey());
+      // We update our current range to an interval that contains no elements.
+      range = NO_KEYS;
+      return rval;
 
 Review comment:
   Yes, for some reason I goofed and forgot how to do a swap using a temp 
variable. I'll submit that as a follow up change since it is a minor 
optimization over the current implementation and the tests passed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 163298)
    Time Spent: 1h 10m  (was: 1h)

> Migrate ByteKeyRangeTracker to use tryClaim(ByteKey.EMPTY) as end of range 
> claim instead of markDone
> ----------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-5974
>                 URL: https://issues.apache.org/jira/browse/BEAM-5974
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-hbase, sdk-java-core
>    Affects Versions: 2.8.0
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> org.apache.beam.sdk.transforms.splittabledofn.ByteKeyRangeTracker doesn't 
> handle tryClaim(ByteKey.EMPTY) and the related doneness check or 
> checkpointing since doneness checking can't handle the empty interval, 
> checkpointing returns invalid checkpoints or errors out since it is using the 
> lastClaimedKey vs the lastAttemptedKey for doneness checking



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to