Class WatermarkOutputMultiplexer
- java.lang.Object
-
- org.apache.flink.api.common.eventtime.WatermarkOutputMultiplexer
-
@Internal public class WatermarkOutputMultiplexer extends Object
AWatermarkOutputMultiplexercombines the watermark (and idleness) updates of multiple partitions/shards/splits into one combined watermark update and forwards it to an underlyingWatermarkOutput.A multiplexed output can either be immediate or deferred. Watermark updates on an immediate output will potentially directly affect the combined watermark state, which will be forwarded to the underlying output immediately. Watermark updates on a deferred output will only update an internal state but not directly update the combined watermark state. Only when
onPeriodicEmit()is called will the deferred updates be combined and forwarded to the underlying output.For registering a new multiplexed output, you must first call
#registerNewOutput(String)and then callgetImmediateOutput(String)orgetDeferredOutput(String)with the output ID you get from that. You can get both an immediate and deferred output for a given output ID, you can also call the getters multiple times.WARNING:This class is not thread safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWatermarkOutputMultiplexer.WatermarkUpdateListenerA callback for propagating changes to split based watermarks.
-
Constructor Summary
Constructors Constructor Description WatermarkOutputMultiplexer(WatermarkOutput underlyingOutput)Creates a newWatermarkOutputMultiplexerthat emits combined updates to the givenWatermarkOutput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WatermarkOutputgetDeferredOutput(String outputId)Returns a deferredWatermarkOutputfor the given output ID.WatermarkOutputgetImmediateOutput(String outputId)Returns an immediateWatermarkOutputfor the given output ID.voidonPeriodicEmit()Tells theWatermarkOutputMultiplexerto combine all outstanding deferred watermark updates and possibly emit a new update to the underlyingWatermarkOutput.voidregisterNewOutput(String id, WatermarkOutputMultiplexer.WatermarkUpdateListener onWatermarkUpdate)Registers a new multiplexed output, which creates internal states for that output and returns an output ID that can be used to get a deferred or immediateWatermarkOutputfor that output.booleanunregisterOutput(String id)
-
-
-
Constructor Detail
-
WatermarkOutputMultiplexer
public WatermarkOutputMultiplexer(WatermarkOutput underlyingOutput)
Creates a newWatermarkOutputMultiplexerthat emits combined updates to the givenWatermarkOutput.
-
-
Method Detail
-
registerNewOutput
public void registerNewOutput(String id, WatermarkOutputMultiplexer.WatermarkUpdateListener onWatermarkUpdate)
Registers a new multiplexed output, which creates internal states for that output and returns an output ID that can be used to get a deferred or immediateWatermarkOutputfor that output.
-
unregisterOutput
public boolean unregisterOutput(String id)
-
getImmediateOutput
public WatermarkOutput getImmediateOutput(String outputId)
Returns an immediateWatermarkOutputfor the given output ID.>See
WatermarkOutputMultiplexerfor a description of immediate and deferred outputs.
-
getDeferredOutput
public WatermarkOutput getDeferredOutput(String outputId)
Returns a deferredWatermarkOutputfor the given output ID.>See
WatermarkOutputMultiplexerfor a description of immediate and deferred outputs.
-
onPeriodicEmit
public void onPeriodicEmit()
Tells theWatermarkOutputMultiplexerto combine all outstanding deferred watermark updates and possibly emit a new update to the underlyingWatermarkOutput.
-
-