@Internal public class StatusWatermarkValve extends Object
StatusWatermarkValve embodies the logic of how Watermark and WatermarkStatus are propagated to downstream outputs, given a set of one or multiple
subpartitions that continuously receive them. Usages of this class need to define the number of
subpartitions that the valve needs to handle, as well as provide a implementation of PushingAsyncDataInput.DataOutput, which is called by the valve only when it determines a new watermark or watermark
status can be propagated.| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
StatusWatermarkValve.SubpartitionStatus
An
SubpartitionStatus keeps track of a subpartition's last watermark, stream status,
and whether or not the subpartition's current watermark is aligned with the overall watermark
output from the valve. |
| 构造器和说明 |
|---|
StatusWatermarkValve(CheckpointedInputGate inputGate) |
StatusWatermarkValve(int numInputChannels)
Returns a new
StatusWatermarkValve. |
StatusWatermarkValve(org.apache.flink.runtime.io.network.partition.ResultSubpartitionIndexSet[] subpartitionIndexSets) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected StatusWatermarkValve.SubpartitionStatus |
getSubpartitionStatus(int subpartitionIndex) |
void |
inputWatermark(Watermark watermark,
int channelIndex,
PushingAsyncDataInput.DataOutput<?> output)
Feed a
Watermark into the valve. |
void |
inputWatermarkStatus(WatermarkStatus watermarkStatus,
int channelIndex,
PushingAsyncDataInput.DataOutput<?> output)
Feed a
WatermarkStatus into the valve. |
@VisibleForTesting public StatusWatermarkValve(int numInputChannels)
StatusWatermarkValve.numInputChannels - the number of input channels that this valve will need to handlepublic StatusWatermarkValve(CheckpointedInputGate inputGate)
public StatusWatermarkValve(org.apache.flink.runtime.io.network.partition.ResultSubpartitionIndexSet[] subpartitionIndexSets)
public void inputWatermark(Watermark watermark, int channelIndex, PushingAsyncDataInput.DataOutput<?> output) throws Exception
Watermark into the valve. If the input triggers the valve to output a new
Watermark, PushingAsyncDataInput.DataOutput.emitWatermark(Watermark) will be called to process the new
Watermark.watermark - the watermark to feed to the valvechannelIndex - the index of the channel that the fed watermark belongs to (index
starting from 0)Exceptionpublic void inputWatermarkStatus(WatermarkStatus watermarkStatus, int channelIndex, PushingAsyncDataInput.DataOutput<?> output) throws Exception
WatermarkStatus into the valve. This may trigger the valve to output either a
new Watermark Status, for which PushingAsyncDataInput.DataOutput.emitWatermarkStatus(WatermarkStatus) will
be called, or a new Watermark, for which PushingAsyncDataInput.DataOutput.emitWatermark(Watermark) will be
called.watermarkStatus - the watermark status to feed to the valvechannelIndex - the index of the channel that the fed watermark status belongs to (index
starting from 0)Exception@VisibleForTesting protected StatusWatermarkValve.SubpartitionStatus getSubpartitionStatus(int subpartitionIndex)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.