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


##########
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:
   It isn't documented as such, but because offset range tracker is 
monotonically increasing, claiming the last offset means that all other offsets 
can't be claimed



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