View Javadoc
1   package org.wikimedia.eventutilities.flink.formats.json;
2   
3   import java.io.Serializable;
4   
5   import org.wikimedia.eventutilities.flink.stream.EventDataStreamFactory;
6   
7   /**
8    * Strategy regarding how to assign the kafka timestamp of the output messages.
9    *
10   * Used by the sink function obtained via
11   * {@link EventDataStreamFactory#kafkaSinkBuilder(String, String, String, String, KafkaRecordTimestampStrategy)}
12   */
13  public enum KafkaRecordTimestampStrategy implements Serializable {
14      /**
15       * Use the timestamp of the flink stream record to populate the event dt field and the kafka timestamp.
16       * Useful for pipeline running in event time semantics, the input Row dt field, if set, is overridden.
17       * Will fail if the pipeline does not assign any timestamp.
18       */
19      FLINK_RECORD_EVENT_TIME,
20  
21      /**
22       * Use the timestamp found in the input Row record.
23       * Useful when the pipeline runs in processing time without any watermarks.
24       * Will fail if the input Row does not have a dt field set.
25       */
26      ROW_EVENT_TIME,
27  
28      /**
29       * Use the ingestion time (obtained from the clock while serializing the event) set to meta.dt.
30       * meta.dt and the kafka record timestamp will be identical.
31       */
32      ROW_INGESTION_TIME
33  }