kennknowles commented on code in PR #27702:
URL: https://github.com/apache/beam/pull/27702#discussion_r1277730535
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/ReadFromKafkaDoFn.java:
##########
@@ -311,17 +324,26 @@ public OffsetRangeTracker restrictionTracker(
if (restriction.getTo() < Long.MAX_VALUE) {
return new OffsetRangeTracker(restriction);
}
- Map<String, Object> updatedConsumerConfig =
- overrideBootstrapServersConfig(consumerConfig, kafkaSourceDescriptor);
- KafkaLatestOffsetEstimator offsetPoller =
- new KafkaLatestOffsetEstimator(
- consumerFactoryFn.apply(
Review Comment:
We saw ~5 rather than ~1 didn't we? I'm in too many chats on this :-). At
heart, I just don't like the code approach of counting on memoizing a result
value as the way we avoid creating a connection, and I prefer having the
automatic creation take place at a higher level in the call stack, ideally at
the DoFn level. I see that SDF and UnboundedSource have the difference that the
topic partition is statically determined vs incoming elements. TBH I'd not
expect a major architectural difference. To be continued!
--
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]