Class TimestampPolicy.PartitionContext

java.lang.Object
org.apache.beam.sdk.io.kafka.TimestampPolicy.PartitionContext
Enclosing class:
TimestampPolicy<K,V>

public abstract static class TimestampPolicy.PartitionContext extends Object
The context contains state maintained in the reader for the partition. Available with each of the methods in @TimestampPolicy.
  • Constructor Details

    • PartitionContext

      public PartitionContext()
  • Method Details

    • getMessageBacklog

      public abstract long getMessageBacklog()
      Current backlog in messages (latest offset of the partition - last processed record offset).
    • getBacklogCheckTime

      public abstract Instant getBacklogCheckTime()
      The time at which latest offset for the partition was fetched in order to calculate backlog. The reader periodically polls for latest offsets. This timestamp is useful in advancing watermark for idle partitions as in TimestampPolicyFactory.LogAppendTimePolicy.