Class BaseBroadcastProcessFunction.ReadOnlyContext
- java.lang.Object
-
- org.apache.flink.streaming.api.functions.co.BaseBroadcastProcessFunction.ReadOnlyContext
-
- Direct Known Subclasses:
BroadcastProcessFunction.ReadOnlyContext
,KeyedBroadcastProcessFunction.ReadOnlyContext
- Enclosing class:
- BaseBroadcastProcessFunction
public abstract class BaseBroadcastProcessFunction.ReadOnlyContext extends Object
Acontext
available to the non-broadcasted stream side of aBroadcastConnectedStream
.Apart from the basic functionality of a
context
, this also allows to get a read-onlyIterable
over the elements stored in the broadcast state.
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract long
currentProcessingTime()
Returns the current processing time.abstract long
currentWatermark()
Returns the current event-time watermark.abstract <K,V>
ReadOnlyBroadcastState<K,V>getBroadcastState(MapStateDescriptor<K,V> stateDescriptor)
Fetches a read-only view of the broadcast state with the specified name.abstract <X> void
output(OutputTag<X> outputTag, X value)
Emits a record to the side output identified by theOutputTag
.abstract Long
timestamp()
Timestamp of the element currently being processed or timestamp of a firing timer.
-
-
-
Method Detail
-
getBroadcastState
public abstract <K,V> ReadOnlyBroadcastState<K,V> getBroadcastState(MapStateDescriptor<K,V> stateDescriptor)
Fetches a read-only view of the broadcast state with the specified name.- Parameters:
stateDescriptor
- theMapStateDescriptor
of the state to be fetched.- Returns:
- The required read-only view of the broadcast state.
-
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(OutputTag<X> outputTag, X value)
Emits a record to the side output identified by theOutputTag
.- Parameters:
outputTag
- theOutputTag
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.
-
-