flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetzger <...@git.apache.org>
Subject [GitHub] flink pull request #2369: [FLINK-4035] Add a streaming connector for Apache ...
Date Mon, 26 Sep 2016 15:08:05 GMT
Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2369#discussion_r80496915
  
    --- 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 --
    
    Yes, I'll do that.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message