@Experimental public abstract class AbstractInput<IN,OUT> extends Object implements Input<IN>, KeyContextHandler, AsyncStateProcessing
Input interface intended to be used when extending AbstractStreamOperatorV2.| Modifier and Type | Field and Description |
|---|---|
protected int |
inputId |
protected Output<StreamRecord<OUT>> |
output |
protected AbstractStreamOperatorV2<OUT> |
owner |
protected org.apache.flink.api.java.functions.KeySelector<?,?> |
stateKeySelector
KeySelector for extracting a key from an element being processed. |
| Constructor and Description |
|---|
AbstractInput(AbstractStreamOperatorV2<OUT> owner,
int inputId) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.util.function.ThrowingConsumer<StreamRecord<IN>,Exception> |
getRecordProcessor(int inputId)
Get the record processor that could process record from input, which is the only entry for
async processing.
|
boolean |
hasKeyContext()
Whether the
Input has "KeyContext". |
boolean |
isAsyncStateProcessingEnabled()
Get if the async state processing is enabled for this input/operator.
|
void |
processLatencyMarker(LatencyMarker latencyMarker)
Processes a
LatencyMarker that arrived on the first input of this two-input operator. |
void |
processRecordAttributes(RecordAttributes recordAttributes)
Processes a
RecordAttributes that arrived at this input. |
void |
processWatermark(Watermark mark)
Processes a
Watermark that arrived on the first input of this two-input operator. |
void |
processWatermarkStatus(WatermarkStatus watermarkStatus)
Processes a
WatermarkStatus that arrived on this input of the MultipleInputStreamOperator. |
void |
setKeyContextElement(StreamRecord record)
Set the correct key context before processing the
record. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessElementhasKeyContext1, hasKeyContext2makeRecordProcessor@Nullable protected final org.apache.flink.api.java.functions.KeySelector<?,?> stateKeySelector
KeySelector for extracting a key from an element being processed. This is used to
scope keyed state to a key. This is null if the operator is not a keyed operator.
This is for elements from the first input.
protected final AbstractStreamOperatorV2<OUT> owner
protected final int inputId
protected final Output<StreamRecord<OUT>> output
public AbstractInput(AbstractStreamOperatorV2<OUT> owner, int inputId)
public void processWatermark(Watermark mark) throws Exception
InputWatermark that arrived on the first input of this two-input operator.
This method is guaranteed to not be called concurrently with other methods of the operator.processWatermark in interface Input<IN>ExceptionWatermarkpublic void processLatencyMarker(LatencyMarker latencyMarker) throws Exception
InputLatencyMarker that arrived on the first input of this two-input operator.
This method is guaranteed to not be called concurrently with other methods of the operator.processLatencyMarker in interface Input<IN>ExceptionLatencyMarkerpublic void processWatermarkStatus(WatermarkStatus watermarkStatus) throws Exception
InputWatermarkStatus that arrived on this input of the MultipleInputStreamOperator. This method is guaranteed to not be called concurrently with
other methods of the operator.processWatermarkStatus in interface Input<IN>ExceptionWatermarkStatuspublic void setKeyContextElement(StreamRecord record) throws Exception
Inputrecord. Used for example to extract
key from the record and pass that key to the state backends. This method is
guaranteed to not be called concurrently with other methods of the operator.setKeyContextElement in interface Input<IN>Exceptionpublic void processRecordAttributes(RecordAttributes recordAttributes) throws Exception
InputRecordAttributes that arrived at this input. This method is guaranteed to
not be called concurrently with other methods of the operator.processRecordAttributes in interface Input<IN>Exceptionpublic boolean hasKeyContext()
KeyContextHandlerInput has "KeyContext". If false, we can omit the call of Input.setKeyContextElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN>) for each record.hasKeyContext in interface KeyContextHandlerInput has "KeyContext", false otherwise.@Internal public final boolean isAsyncStateProcessingEnabled()
AsyncStateProcessingisAsyncStateProcessingEnabled in interface AsyncStateProcessing@Internal public final org.apache.flink.util.function.ThrowingConsumer<StreamRecord<IN>,Exception> getRecordProcessor(int inputId)
AsyncStateProcessinggetRecordProcessor in interface AsyncStateProcessinginputId - the input identifier, start from 1. Borrow the design from org.apache.flink.streaming.api.operators.AbstractInput#inputId. This is only relevant if
there is multiple inputs for the instance.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.