CARVIEW |
Select Language
HTTP/2 200
server: Apache
last-modified: Thu, 03 Jul 2025 18:14:56 GMT
etag: "3e3e-6390a5acdbe92-gzip"
content-encoding: gzip
access-control-allow-origin: *
content-security-policy: frame-src 'self' https://play.beam.apache.org/ https://www.youtube.com/ https://drive.google.com/ ;
content-type: text/html
via: 1.1 varnish, 1.1 varnish
accept-ranges: bytes
date: Sat, 19 Jul 2025 14:31:45 GMT
age: 0
x-served-by: cache-hel1410023-HEL, cache-bom4735-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1752935506.819033,VS0,VE161
vary: Accept-Encoding
strict-transport-security: max-age=31536000; includeSubDomains; preload
content-length: 3017
TimestampPolicy (Apache Beam 2.66.0)
org.apache.beam.sdk.io.kafka
Class TimestampPolicy<K,V>
- java.lang.Object
-
- org.apache.beam.sdk.io.kafka.TimestampPolicy<K,V>
-
- Direct Known Subclasses:
- CustomTimestampPolicyWithLimitedDelay, TimestampPolicyFactory.LogAppendTimePolicy, TimestampPolicyFactory.ProcessingTimePolicy, TimestampPolicyFactory.TimestampFnPolicy
public abstract class TimestampPolicy<K,V> extends java.lang.Object
A timestamp policy to assign event time for messages in a Kafka partition and watermark for it. KafkaIO reader creates one policy usingTimestampPolicyFactory
for each each of the partitions it reads from. See @TimestampPolicyFactory.LogAppendTimePolicy
for example of a policy.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
TimestampPolicy.PartitionContext
The context contains state maintained in the reader for the partition.
-
Constructor Summary
Constructors Constructor and Description TimestampPolicy()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description abstract Instant
getTimestampForRecord(TimestampPolicy.PartitionContext ctx, KafkaRecord<K,V> record)
Returns record timestamp (aka event time).abstract Instant
getWatermark(TimestampPolicy.PartitionContext ctx)
Returns watermark for the partition.
-
-
-
Method Detail
-
getTimestampForRecord
public abstract 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 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. 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.
-
-