Class WatermarkOutputMultiplexer


  • @Internal
    public class WatermarkOutputMultiplexer
    extends Object
    A WatermarkOutputMultiplexer combines the watermark (and idleness) updates of multiple partitions/shards/splits into one combined watermark update and forwards it to an underlying WatermarkOutput.

    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 call getImmediateOutput(String) or getDeferredOutput(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.