@Internal public abstract class AbstractAsyncStateStreamOperator<OUT> extends AbstractStreamOperator<OUT> implements AsyncStateProcessingOperator
AbstractStreamOperator the ability to
perform AsyncStateProcessing. The aim is to make any subclass of AbstractStreamOperator could manipulate async state with only a change of base class.chainingStrategy, config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager| 构造器和说明 |
|---|
AbstractAsyncStateStreamOperator() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
getCurrentKey() |
ElementOrder |
getElementOrder()
Get the
ElementOrder of this operator. |
<K,N> InternalTimerService<N> |
getInternalTimerService(String name,
org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
Triggerable<K,N> triggerable)
Returns a
InternalTimerService that can be used to query current processing time and
event time and to set timers. |
<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.
|
void |
initializeState(StreamTaskStateInitializer streamTaskStateManager)
Initialize necessary state components for
AbstractStreamOperator. |
boolean |
isAsyncStateProcessingEnabled()
Get if the async state processing is enabled for this input/operator.
|
void |
postProcessElement()
A callback that will be triggered after an element finishes
processElement. |
void |
preserveRecordOrderAndProcess(org.apache.flink.util.function.ThrowingRunnable<Exception> processing)
Check the order of same-key record, and then process the record.
|
void |
processWatermark(Watermark mark) |
void |
processWatermarkStatus(WatermarkStatus watermarkStatus) |
<T> void |
setAsyncKeyedContextElement(StreamRecord<T> record,
org.apache.flink.api.java.functions.KeySelector<T,?> keySelector)
Set key context for async state processing.
|
void |
setKeyContextElement1(StreamRecord record) |
void |
setKeyContextElement2(StreamRecord record) |
OperatorSnapshotFutures |
snapshotState(long checkpointId,
long timestamp,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions,
org.apache.flink.runtime.state.CheckpointStreamFactory factory)
Called to draw a state snapshot from the operator.
|
close, finish, getChainingStrategy, getContainingTask, getExecutionConfig, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, open, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark1, processWatermark2, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, useSplittableTimersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmakeRecordProcessorgetOperatorAttributeshasKeyContextpublic void initializeState(StreamTaskStateInitializer streamTaskStateManager) throws Exception
AbstractStreamOperator.initializeState 在接口中 StreamOperator<OUT>initializeState 在类中 AbstractStreamOperator<OUT>Exceptionpublic boolean isAsyncStateProcessingEnabled()
AsyncStateProcessingisAsyncStateProcessingEnabled 在接口中 AsyncStateProcessingpublic ElementOrder getElementOrder()
AsyncStateProcessingOperatorElementOrder of this operator.getElementOrder 在接口中 AsyncStateProcessingOperatorpublic final <T> void setAsyncKeyedContextElement(StreamRecord<T> record, org.apache.flink.api.java.functions.KeySelector<T,?> keySelector) throws Exception
AsyncStateProcessingOperatorsetAsyncKeyedContextElement 在接口中 AsyncStateProcessingOperatorT - the type of the record.record - the record.keySelector - the key selector to select a key from record.Exceptionpublic final void postProcessElement()
AsyncStateProcessingOperatorprocessElement.public final void preserveRecordOrderAndProcess(org.apache.flink.util.function.ThrowingRunnable<Exception> processing)
AsyncStateProcessingOperatorAsyncStateProcessingOperator.getElementOrder() returns ElementOrder.RECORD_ORDER.preserveRecordOrderAndProcess 在接口中 AsyncStateProcessingOperatorprocessing - the record processing logic.public final <T> org.apache.flink.util.function.ThrowingConsumer<StreamRecord<T>,Exception> getRecordProcessor(int inputId)
AsyncStateProcessinggetRecordProcessor 在接口中 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.public final OperatorSnapshotFutures snapshotState(long checkpointId, long timestamp, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions, org.apache.flink.runtime.state.CheckpointStreamFactory factory) throws Exception
StreamOperatorsnapshotState 在接口中 StreamOperator<OUT>snapshotState 在类中 AbstractStreamOperator<OUT>Exception - exception that happened during snapshotting.public <K,N> InternalTimerService<N> getInternalTimerService(String name, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, Triggerable<K,N> triggerable)
InternalTimerService that can be used to query current processing time and
event time and to set timers. An operator can have several timer services, where each has its
own namespace serializer. Timer services are differentiated by the string key that is given
when requesting them, if you call this method with the same key multiple times you will get
the same timer service instance in subsequent requests.
Timers are always scoped to a key, the currently active key of a keyed stream operation. When a timer fires, this key will also be set as the currently active key.
Each timer has attached metadata, the namespace. Different timer services can have a
different namespace type. If you don't need namespace differentiation you can use VoidNamespaceSerializer as the namespace serializer.
getInternalTimerService 在类中 AbstractStreamOperator<OUT>N - The type of the timer namespace.name - The name of the requested timer service. If no service exists under the given
name a new one will be created and returned.namespaceSerializer - TypeSerializer for the timer namespace.triggerable - The Triggerable that should be invoked when timers firepublic void setKeyContextElement1(StreamRecord record) throws Exception
setKeyContextElement1 在接口中 StreamOperator<OUT>setKeyContextElement1 在类中 AbstractStreamOperator<OUT>Exceptionpublic void setKeyContextElement2(StreamRecord record) throws Exception
setKeyContextElement2 在接口中 StreamOperator<OUT>setKeyContextElement2 在类中 AbstractStreamOperator<OUT>Exceptionpublic Object getCurrentKey()
getCurrentKey 在接口中 KeyContextgetCurrentKey 在类中 AbstractStreamOperator<OUT>public void processWatermark(Watermark mark) throws Exception
processWatermark 在类中 AbstractStreamOperator<OUT>Exceptionpublic void processWatermarkStatus(WatermarkStatus watermarkStatus) throws Exception
processWatermarkStatus 在类中 AbstractStreamOperator<OUT>ExceptionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.