Class AbstractInput<IN,OUT>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.AbstractInput<IN,OUT>
-
- All Implemented Interfaces:
Input<IN>,KeyContextHandler,AsyncStateProcessing
@Experimental public abstract class AbstractInput<IN,OUT> extends Object implements Input<IN>, KeyContextHandler, AsyncStateProcessing
Base abstract implementation ofInputinterface intended to be used when extendingAbstractStreamOperatorV2.
-
-
Field Summary
Fields Modifier and Type Field Description protected intinputIdprotected Output<StreamRecord<OUT>>outputprotected AbstractStreamOperatorV2<OUT>ownerprotected org.apache.flink.api.java.functions.KeySelector<?,?>stateKeySelectorKeySelectorfor extracting a key from an element being processed.
-
Constructor Summary
Constructors Constructor Description AbstractInput(AbstractStreamOperatorV2<OUT> owner, int inputId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.booleanhasKeyContext()Whether theInputhas "KeyContext".booleanisAsyncStateProcessingEnabled()Get if the async state processing is enabled for this input/operator.voidprocessLatencyMarker(LatencyMarker latencyMarker)Processes aLatencyMarkerthat arrived on the first input of this two-input operator.voidprocessRecordAttributes(RecordAttributes recordAttributes)Processes aRecordAttributesthat arrived at this input.voidprocessWatermark(Watermark mark)Processes aWatermarkthat arrived on the first input of this two-input operator.voidprocessWatermarkStatus(WatermarkStatus watermarkStatus)Processes aWatermarkStatusthat arrived on this input of theMultipleInputStreamOperator.voidsetKeyContextElement(StreamRecord record)Set the correct key context before processing therecord.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.streaming.api.operators.Input
processElement
-
Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler
hasKeyContext1, hasKeyContext2
-
-
-
-
Field Detail
-
stateKeySelector
@Nullable protected final org.apache.flink.api.java.functions.KeySelector<?,?> stateKeySelector
KeySelectorfor 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.
-
owner
protected final AbstractStreamOperatorV2<OUT> owner
-
inputId
protected final int inputId
-
output
protected final Output<StreamRecord<OUT>> output
-
-
Constructor Detail
-
AbstractInput
public AbstractInput(AbstractStreamOperatorV2<OUT> owner, int inputId)
-
-
Method Detail
-
processWatermark
public void processWatermark(Watermark mark) throws Exception
Description copied from interface:InputProcesses aWatermarkthat 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.- Specified by:
processWatermarkin interfaceInput<IN>- Throws:
Exception- See Also:
Watermark
-
processLatencyMarker
public void processLatencyMarker(LatencyMarker latencyMarker) throws Exception
Description copied from interface:InputProcesses aLatencyMarkerthat 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.- Specified by:
processLatencyMarkerin interfaceInput<IN>- Throws:
Exception- See Also:
LatencyMarker
-
processWatermarkStatus
public void processWatermarkStatus(WatermarkStatus watermarkStatus) throws Exception
Description copied from interface:InputProcesses aWatermarkStatusthat arrived on this input of theMultipleInputStreamOperator. This method is guaranteed to not be called concurrently with other methods of the operator.- Specified by:
processWatermarkStatusin interfaceInput<IN>- Throws:
Exception- See Also:
WatermarkStatus
-
setKeyContextElement
public void setKeyContextElement(StreamRecord record) throws Exception
Description copied from interface:InputSet the correct key context before processing therecord. Used for example to extract key from therecordand pass that key to the state backends. This method is guaranteed to not be called concurrently with other methods of the operator.- Specified by:
setKeyContextElementin interfaceInput<IN>- Throws:
Exception
-
processRecordAttributes
public void processRecordAttributes(RecordAttributes recordAttributes) throws Exception
Description copied from interface:InputProcesses aRecordAttributesthat arrived at this input. This method is guaranteed to not be called concurrently with other methods of the operator.- Specified by:
processRecordAttributesin interfaceInput<IN>- Throws:
Exception
-
hasKeyContext
public boolean hasKeyContext()
Description copied from interface:KeyContextHandlerWhether theInputhas "KeyContext". If false, we can omit the call ofInput.setKeyContextElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN>)for each record.- Specified by:
hasKeyContextin interfaceKeyContextHandler- Returns:
- True if the
Inputhas "KeyContext", false otherwise.
-
isAsyncStateProcessingEnabled
@Internal public final boolean isAsyncStateProcessingEnabled()
Description copied from interface:AsyncStateProcessingGet if the async state processing is enabled for this input/operator.- Specified by:
isAsyncStateProcessingEnabledin interfaceAsyncStateProcessing- Returns:
- ture if async state processing is enabled.
-
getRecordProcessor
@Internal public final org.apache.flink.util.function.ThrowingConsumer<StreamRecord<IN>,Exception> getRecordProcessor(int inputId)
Description copied from interface:AsyncStateProcessingGet the record processor that could process record from input, which is the only entry for async processing.- Specified by:
getRecordProcessorin interfaceAsyncStateProcessing- Parameters:
inputId- the input identifier, start from 1. Borrow the design fromorg.apache.flink.streaming.api.operators.AbstractInput#inputId. This is only relevant if there is multiple inputs for the instance.
-
-