sjvanrossum commented on code in PR #39285:
URL: https://github.com/apache/beam/pull/39285#discussion_r3562428330
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFn.java:
##########
@@ -510,9 +449,10 @@ public UnsplittableRestrictionTracker<OffsetRange, Long>
restrictionTracker(
// OffsetEstimators are cached for each topic-partition because they hold
a stateful connection,
// so we want to minimize the amount of connections that we start and
track with Kafka. Another
// point is that it has a memoized backlog, and this should make that more
reusable estimations.
+ final AtomicLong latestOffsetEstimator =
+ latestOffsetEstimatorCache.getUnchecked(kafkaSourceDescriptor);
return new UnsplittableRestrictionTracker<>(
- new GrowableOffsetRangeTracker(
- restriction.getFrom(),
latestOffsetEstimatorCache.getUnchecked(kafkaSourceDescriptor)));
+ new GrowableOffsetRangeTracker(restriction.getFrom(),
latestOffsetEstimator::get));
Review Comment:
This explanation and suggestion look wrong to me. Provide a source reference
for the runner behavior.
Docs for `GrowableOffsetRangeTracker.RangeEndEstimator` state:
> `Return {@code Long.MIN_VALUE} if an estimate can not be provided.`
--
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]