Class TimestampPolicy<K,​V>

    • Constructor Detail

      • TimestampPolicy

        public TimestampPolicy()
    • Method Detail

      • getTimestampForRecord

        public abstract org.joda.time.Instant getTimestampForRecord​(TimestampPolicy.PartitionContext ctx,
                                                                    KafkaRecord<K,​V> record)
        Returns record timestamp (aka event time). This is often based on the timestamp of the Kafka record. This is invoked for each record when it is processed in the reader.
      • getWatermark

        public abstract org.joda.time.Instant getWatermark​(TimestampPolicy.PartitionContext ctx)
        Returns watermark for the partition. It is the timestamp before or at the timestamps of all future records consumed from the partition. See UnboundedSource.UnboundedReader.getWatermark() for more guidance on watermarks. E.g. if the record timestamp is 'LogAppendTime', watermark would be the timestamp of the last record since 'LogAppendTime' monotonically increases within a partition.