Package org.apache.beam.sdk.io.kafka
Class TimestampPolicyFactory.LogAppendTimePolicy<K,V>
java.lang.Object
org.apache.beam.sdk.io.kafka.TimestampPolicy<K,V>
org.apache.beam.sdk.io.kafka.TimestampPolicyFactory.LogAppendTimePolicy<K,V>
- Enclosing interface:
TimestampPolicyFactory<KeyT,ValueT>
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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.kafka.TimestampPolicy
TimestampPolicy.PartitionContext -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTimestampForRecord(TimestampPolicy.PartitionContext context, KafkaRecord<K, V> record) Returns record timestamp (aka event time).Returns watermark for the partition.
-
Field Details
-
currentWatermark
-
-
Constructor Details
-
LogAppendTimePolicy
-
-
Method Details
-
getTimestampForRecord
public Instant getTimestampForRecord(TimestampPolicy.PartitionContext context, KafkaRecord<K, V> record) Description copied from class:TimestampPolicyReturns 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.- Specified by:
getTimestampForRecordin classTimestampPolicy<K,V>
-
getWatermark
Description copied from class:TimestampPolicyReturns watermark for the partition. It is the timestamp before or at the timestamps of all future records consumed from the partition. SeeUnboundedSource.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:
getWatermarkin classTimestampPolicy<K,V>
-