PatrickRen commented on code in PR #54:
URL:
https://github.com/apache/flink-connector-kafka/pull/54#discussion_r1361751578
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/reader/KafkaPartitionSplitReader.java:
##########
@@ -110,6 +110,13 @@ public RecordsWithSplitIds<ConsumerRecord<byte[], byte[]>>
fetch() throws IOExce
markEmptySplitsAsFinished(recordsBySplits);
return recordsBySplits;
}
+
+ // Track the record fetch lag
+ consumerRecords
+ .iterator()
+ .forEachRemaining(
+ record ->
kafkaSourceReaderMetrics.recordFetched(record.timestamp()));
Review Comment:
@Tan-JiaLiang The event time is the same in these two metrics.
The event time of a record is determined by two ways:
1. Use the event time emitted by `SourceOutput#collect(record, timestamp)`,
which is the code snippet you mentioned in `KafkaRecordEmitter`
2. Use the user specified `TimestampAssigner`, which will **override** the
event time in 1:
https://github.com/apache/flink/blob/935188f06a8a94b3a2c991a8aa6e48b2bfaeee70/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/source/SourceOutputWithWatermarks.java#L107
--
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]