Package org.apache.beam.sdk.io.kafka
Class TimestampPolicyFactory.TimestampFnPolicy<K,V>
java.lang.Object
org.apache.beam.sdk.io.kafka.TimestampPolicy<K,V>
org.apache.beam.sdk.io.kafka.TimestampPolicyFactory.TimestampFnPolicy<K,V>
- Enclosing interface:
TimestampPolicyFactory<KeyT,
ValueT>
Internal policy to support deprecated withTimestampFn API. It returns last record timestamp for
watermark!.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.io.kafka.TimestampPolicy
TimestampPolicy.PartitionContext
-
Method Summary
Modifier and TypeMethodDescriptiongetTimestampForRecord
(TimestampPolicy.PartitionContext context, KafkaRecord<K, V> record) Returns record timestamp (aka event time).Returns watermark for the partition.
-
Method Details
-
getTimestampForRecord
public Instant getTimestampForRecord(TimestampPolicy.PartitionContext context, KafkaRecord<K, V> record) Description copied from class:TimestampPolicy
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.- Specified by:
getTimestampForRecord
in classTimestampPolicy<K,
V>
-
getWatermark
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. 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:
getWatermark
in classTimestampPolicy<K,
V>
-