Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2369#discussion_r76274826
  
    --- Diff: 
flink-streaming-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/Kafka010Fetcher.java
 ---
    @@ -60,12 +60,17 @@ protected void 
assignPartitionsToConsumer(KafkaConsumer<byte[], byte[]> consumer
                consumer.assign(topicPartitions);
        }
     
    +   @Override
    +   protected void emitRecord(T record, 
KafkaTopicPartitionState<TopicPartition> partition, long offset, ConsumerRecord 
consumerRecord) throws Exception {
    +           // pass timestamp
    +           super.emitRecord(record, partition, offset, 
consumerRecord.timestamp());
    +   }
    +
        /**
         * Emit record Kafka-timestamp aware.
         */
        @Override
    -   protected <R> void emitRecord(T record, 
KafkaTopicPartitionState<TopicPartition> partitionState, long offset, R 
kafkaRecord) throws Exception {
    -           long timestamp = ((ConsumerRecord) kafkaRecord).timestamp();
    +   protected void emitRecord(T record, 
KafkaTopicPartitionState<TopicPartition> partitionState, long offset, long 
timestamp) throws Exception {
                if (timestampWatermarkMode == NO_TIMESTAMPS_WATERMARKS) {
    --- End diff --
    
    Is it possible to let `AbstractFetcher#emitRecord` determine whether to 
call `collectWithTimestamp` or `collect` depending on the provided timestamp 
(== `Long.MIN_VALUE`)? Then, we won't need to override the base `emitRecord` 
here, correct?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to