curcur commented on a change in pull request #11725:
URL: https://github.com/apache/flink/pull/11725#discussion_r426129684
##########
File path:
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaFetcher.java
##########
@@ -192,6 +176,29 @@ protected String getFetcherName() {
return "Kafka Fetcher";
}
+ protected void partitionConsumerRecordsHandler(
+ List<ConsumerRecord<byte[], byte[]>> partitionRecords,
+ KafkaTopicPartitionState<TopicPartition> partition)
throws Exception {
+
+ for (ConsumerRecord<byte[], byte[]> record : partitionRecords) {
+ deserializer.deserialize(record, kafkaCollector);
+
+ // emit the actual records. this also updates offset
state atomically and emits
+ // watermarks
+ emitRecordsWithTimestamps(
+ kafkaCollector.getRecords(),
+ partition,
+ record.offset(),
+ record.timestamp());
+
+ if (kafkaCollector.isEndOfStreamSignalled()) {
+ // end of stream signaled
+ running = false;
+ break;
+ }
Review comment:
> Much better now, but I would have just extracted this inside of the
for loop, since the loop itself is also the same.
It would be a bit tricky because it has a for-loop break; I have to change
the logic inside. At this time, I would prefer to make more safe changes...
----------------------------------------------------------------
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]