Interface AsyncStateProcessing
- All Known Subinterfaces:
AsyncStateProcessingOperator
- All Known Implementing Classes:
AbstractAsyncStateStreamOperator,AbstractAsyncStateStreamOperatorV2,AbstractAsyncStateUdfStreamOperator,AsyncEvictingWindowOperator,AsyncIntervalJoinOperator,AsyncKeyedProcessOperator,AsyncStreamFlatMap,AsyncWindowOperator,StreamGroupedReduceAsyncStateOperator
@Internal
public interface AsyncStateProcessing
This class defines the basic interfaces to process a state in operator/input layer.
-
Method Summary
Modifier and TypeMethodDescription<T> org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>,Exception> getRecordProcessor(int inputId) Get the record processor that could process record from input, which is the only entry for async processing.booleanGet if the async state processing is enabled for this input/operator.static <T> org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>,Exception> makeRecordProcessor(AsyncStateProcessingOperator asyncOperator, org.apache.flink.api.java.functions.KeySelector<T, ?> keySelector, org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>, Exception> processor) Static method helper to make a record processor with given infos.
-
Method Details
-
isAsyncStateProcessingEnabled
boolean isAsyncStateProcessingEnabled()Get if the async state processing is enabled for this input/operator.- Returns:
- ture if async state processing is enabled.
-
getRecordProcessor
<T> org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>,Exception> getRecordProcessor(int inputId) Get the record processor that could process record from input, which is the only entry for async processing.- 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.
-
makeRecordProcessor
static <T> org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>,Exception> makeRecordProcessor(AsyncStateProcessingOperator asyncOperator, org.apache.flink.api.java.functions.KeySelector<T, ?> keySelector, org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>, Exception> processor) Static method helper to make a record processor with given infos.- Parameters:
asyncOperator- the operator that can process state asynchronously.keySelector- the key selector.processor- the record processing logic.- Returns:
- the built record processor that can returned by
getRecordProcessor(int).
-