Class KeyedBroadcastProcessFunction.ReadOnlyContext

java.lang.Object
org.apache.flink.streaming.api.functions.co.BaseBroadcastProcessFunction.ReadOnlyContext
org.apache.flink.streaming.api.functions.co.KeyedBroadcastProcessFunction.ReadOnlyContext
Direct Known Subclasses:
KeyedBroadcastProcessFunction.OnTimerContext
Enclosing class:
KeyedBroadcastProcessFunction<KS,IN1,IN2,OUT>

public abstract class KeyedBroadcastProcessFunction.ReadOnlyContext extends BaseBroadcastProcessFunction.ReadOnlyContext
A context available to the keyed stream side of a BroadcastConnectedStream (if any).

Apart from the basic functionality of a context, this also allows to get a read-only Iterable over the elements stored in the broadcast state and a TimerService for querying time and registering timers.

  • Constructor Details

    • ReadOnlyContext

      public ReadOnlyContext()
  • Method Details

    • timerService

      public abstract TimerService timerService()
      A TimerService for querying time and registering timers.
    • getCurrentKey

      public abstract KS getCurrentKey()
      Get key of the element being processed.
    • timestamp

      public abstract Long timestamp()
      Timestamp of the element currently being processed or timestamp of a firing timer.

      This might be null, depending on the stream's watermark strategy.

    • output

      public abstract <X> void output(org.apache.flink.util.OutputTag<X> outputTag, X value)
      Emits a record to the side output identified by the OutputTag.
      Parameters:
      outputTag - the OutputTag that identifies the side output to emit to.
      value - The record to emit.
    • currentProcessingTime

      public abstract long currentProcessingTime()
      Returns the current processing time.
    • currentWatermark

      public abstract long currentWatermark()
      Returns the current event-time watermark.