Class TableKeyedAsyncWaitOperator<IN,​OUT,​KEY>

  • Type Parameters:
    IN - Input type for the operator.
    OUT - Output type for the operator.
    KEY - Key type for the operator.
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.state.CheckpointListener, org.apache.flink.streaming.api.operators.BoundedOneInput, org.apache.flink.streaming.api.operators.Input<IN>, org.apache.flink.streaming.api.operators.KeyContext, org.apache.flink.streaming.api.operators.KeyContextHandler, org.apache.flink.streaming.api.operators.OneInputStreamOperator<IN,​OUT>, org.apache.flink.streaming.api.operators.OutputTypeConfigurable<OUT>, org.apache.flink.streaming.api.operators.StreamOperator<OUT>, org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator, org.apache.flink.streaming.api.operators.UserFunctionProvider<org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT>>, org.apache.flink.streaming.api.operators.YieldingOperator<OUT>

    public class TableKeyedAsyncWaitOperator<IN,​OUT,​KEY>
    extends org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,​org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT>>
    implements org.apache.flink.streaming.api.operators.OneInputStreamOperator<IN,​OUT>, org.apache.flink.streaming.api.operators.BoundedOneInput
    This operator serves a similar purpose to AsyncWaitOperator. Unlike AsyncWaitOperator, this operator supports key-ordered async processing.

    If the planner can infer the upsert key, then the order key used for processing will be the upsert key; otherwise, the entire row will be treated as the order key.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.flink.streaming.runtime.streamrecord.StreamElementSerializer<IN> inStreamElementSerializer
      TypeSerializer for inputs while making snapshots.
      protected static org.slf4j.Logger LOG  
      protected boolean needDeepCopy  
      protected org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> timestampedCollector  
      • Fields inherited from class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator

        userFunction
      • Fields inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator

        combinedWatermark, config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager
    • Constructor Summary

      Constructors 
      Constructor Description
      TableKeyedAsyncWaitOperator​(org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT> asyncFunction, org.apache.flink.api.java.functions.KeySelector<IN,​KEY> keySelector, long timeout, int capacity, org.apache.flink.streaming.runtime.tasks.ProcessingTimeService processingTimeService, org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void emitWatermark​(org.apache.flink.streaming.api.watermark.Watermark mark)  
      void endInput()  
      TableAsyncExecutionController<IN,​OUT,​KEY> getAsyncExecutionController()  
      KEY getKey​(AecRecord<IN,​OUT> aecRecord)  
      void initializeState​(org.apache.flink.runtime.state.StateInitializationContext context)  
      void invoke​(AecRecord<IN,​OUT> element)  
      void open()  
      void processElement​(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> record)  
      void processWatermark​(org.apache.flink.streaming.api.watermark.Watermark mark)  
      void setup​(org.apache.flink.streaming.runtime.tasks.StreamTask<?,​?> containingTask, org.apache.flink.streaming.api.graph.StreamConfig config, org.apache.flink.streaming.api.operators.Output<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<OUT>> output)  
      org.apache.flink.streaming.api.operators.OperatorSnapshotFutures snapshotState​(long checkpointId, long timestamp, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions, org.apache.flink.runtime.state.CheckpointStreamFactory factory)  
      void waitInFlightInputsFinished()  
      • Methods inherited from class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator

        close, finish, getUserFunction, getUserFunctionParameters, notifyCheckpointAborted, notifyCheckpointComplete, setOutputType, snapshotState
      • Methods inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator

        beforeInitializeStateHandler, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isAsyncKeyOrderedProcessingEnabled, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark1, processWatermark2, processWatermark2, processWatermarkStatus, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, useSplittableTimers
      • Methods inherited from interface org.apache.flink.api.common.state.CheckpointListener

        notifyCheckpointAborted, notifyCheckpointComplete
      • Methods inherited from interface org.apache.flink.streaming.api.operators.Input

        processLatencyMarker, processRecordAttributes, processWatermark, processWatermarkStatus
      • Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContext

        getCurrentKey, setCurrentKey
      • Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler

        hasKeyContext
      • Methods inherited from interface org.apache.flink.streaming.api.operators.OneInputStreamOperator

        setKeyContextElement
      • Methods inherited from interface org.apache.flink.streaming.api.operators.StreamOperator

        close, finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • inStreamElementSerializer

        protected transient org.apache.flink.streaming.runtime.streamrecord.StreamElementSerializer<IN> inStreamElementSerializer
        TypeSerializer for inputs while making snapshots.
      • timestampedCollector

        protected transient org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> timestampedCollector
      • needDeepCopy

        protected transient boolean needDeepCopy
    • Constructor Detail

      • TableKeyedAsyncWaitOperator

        public TableKeyedAsyncWaitOperator​(org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT> asyncFunction,
                                           org.apache.flink.api.java.functions.KeySelector<IN,​KEY> keySelector,
                                           long timeout,
                                           int capacity,
                                           org.apache.flink.streaming.runtime.tasks.ProcessingTimeService processingTimeService,
                                           org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor)
    • Method Detail

      • setup

        public void setup​(org.apache.flink.streaming.runtime.tasks.StreamTask<?,​?> containingTask,
                          org.apache.flink.streaming.api.graph.StreamConfig config,
                          org.apache.flink.streaming.api.operators.Output<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<OUT>> output)
        Overrides:
        setup in class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,​org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT>>
      • initializeState

        public void initializeState​(org.apache.flink.runtime.state.StateInitializationContext context)
                             throws Exception
        Specified by:
        initializeState in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator
        Overrides:
        initializeState in class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,​org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT>>
        Throws:
        Exception
      • open

        public void open()
                  throws Exception
        Specified by:
        open in interface org.apache.flink.streaming.api.operators.StreamOperator<IN>
        Overrides:
        open in class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,​org.apache.flink.streaming.api.functions.async.AsyncFunction<IN,​OUT>>
        Throws:
        Exception
      • processElement

        public void processElement​(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> record)
                            throws Exception
        Specified by:
        processElement in interface org.apache.flink.streaming.api.operators.Input<IN>
        Throws:
        Exception
      • processWatermark

        public void processWatermark​(org.apache.flink.streaming.api.watermark.Watermark mark)
                              throws Exception
        Specified by:
        processWatermark in interface org.apache.flink.streaming.api.operators.Input<IN>
        Overrides:
        processWatermark in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
        Throws:
        Exception
      • snapshotState

        public org.apache.flink.streaming.api.operators.OperatorSnapshotFutures snapshotState​(long checkpointId,
                                                                                              long timestamp,
                                                                                              org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions,
                                                                                              org.apache.flink.runtime.state.CheckpointStreamFactory factory)
                                                                                       throws Exception
        Specified by:
        snapshotState in interface org.apache.flink.streaming.api.operators.StreamOperator<IN>
        Overrides:
        snapshotState in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
        Throws:
        Exception
      • endInput

        public void endInput()
                      throws Exception
        Specified by:
        endInput in interface org.apache.flink.streaming.api.operators.BoundedOneInput
        Throws:
        Exception
      • emitWatermark

        public void emitWatermark​(org.apache.flink.streaming.api.watermark.Watermark mark)