boyuanzz commented on a change in pull request #11454:
URL: https://github.com/apache/beam/pull/11454#discussion_r414074333



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/splittabledofn/ByteKeyRangeTracker.java
##########
@@ -64,31 +64,56 @@ public ByteKeyRange currentRestriction() {
 
   @Override
   public SplitResult<ByteKeyRange> trySplit(double fractionOfRemainder) {
-    // TODO(BEAM-8871): Add support for splitting off a fixed amount of work 
for this restriction
-    // instead of only supporting checkpointing.
+    // No split on an empty range.
+    if (NO_KEYS.equals(range)) {

Review comment:
       I think the major question is about `startKey == endKey` or `NO_KEYS`. 
There are 2 options in my mind:
   1. Use `startKey == endKey` and `NO_KEYS` to represent an empty key range. 
   2. Only use `NO_KEYS` as a notion of empty key range. In order to do this, 
we need to change the current range to `NO_KEYS` after checkpointing if 
necessary.
   I chose option 2 as my current implementation, that's why I only exam 
`NO_KEYS` in `tryClaim` and `checkDone`. 
   
   What do you think? 




----------------------------------------------------------------
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]


Reply via email to