Abacn commented on code in PR #22962:
URL: https://github.com/apache/beam/pull/22962#discussion_r961911782


##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFn.java:
##########
@@ -343,6 +343,9 @@ public ProcessContinuation processElement(
     // Stop processing current TopicPartition when it's time to stop.
     if (checkStopReadingFn != null
         && 
checkStopReadingFn.apply(kafkaSourceDescriptor.getTopicPartition())) {
+      // Attempt to claim the last element in the restriction, such that the 
restriction tracker
+      // doesn't throw an exception when checkDone is called

Review Comment:
   That makes sense. Nice to comment here that this condition relies on the 
(assumption of) "offset range tracker is always monotonically increasing"
   Will take another look and tests



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to