Class TimestampPolicyFactory.LogAppendTimePolicy<K,​V>

  • Enclosing interface:
    TimestampPolicyFactory<KeyT,​ValueT>

    public static class TimestampPolicyFactory.LogAppendTimePolicy<K,​V>
    extends TimestampPolicy<K,​V>
    Assigns Kafka's log append time (server side ingestion time) to each record. The watermark for each Kafka partition is the timestamp of the last record read. If a partition is idle, the watermark advances roughly to 'current time - 2 seconds'. See KafkaIO.Read.withLogAppendTime() for longer description.
    • Field Detail

      • currentWatermark

        protected org.joda.time.Instant currentWatermark
    • Constructor Detail

      • LogAppendTimePolicy

        public LogAppendTimePolicy​(java.util.Optional<org.joda.time.Instant> previousWatermark)
    • Method Detail

      • getWatermark

        public org.joda.time.Instant getWatermark​(TimestampPolicy.PartitionContext context)
        Description copied from class: TimestampPolicy
        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.
        Specified by:
        getWatermark in class TimestampPolicy<K,​V>