Package org.apache.flink.cep.operator
Class CepOperator<IN,KEY,OUT>
java.lang.Object
org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
org.apache.flink.cep.operator.CepOperator<IN,KEY,OUT>
- Type Parameters:
IN- Type of the input elementsKEY- Type of the key on which the input stream is keyedOUT- Type of the output elements
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.state.CheckpointListener,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.Triggerable<KEY,,org.apache.flink.runtime.state.VoidNamespace> org.apache.flink.streaming.api.operators.UserFunctionProvider<PatternProcessFunction<IN,,OUT>> org.apache.flink.streaming.api.operators.YieldingOperator<OUT>
@Internal
public class CepOperator<IN,KEY,OUT>
extends org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
implements org.apache.flink.streaming.api.operators.OneInputStreamOperator<IN,OUT>, org.apache.flink.streaming.api.operators.Triggerable<KEY,org.apache.flink.runtime.state.VoidNamespace>
CEP pattern operator for a keyed input stream. For each key, the operator creates a
NFA
and a priority queue to buffer out of order elements. Both data structures are stored using the
managed keyed state.- See Also:
-
Field Summary
Fields inherited from class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator
userFunctionFields inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
combinedWatermark, config, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager -
Constructor Summary
ConstructorsConstructorDescriptionCepOperator(org.apache.flink.api.common.typeutils.TypeSerializer<IN> inputSerializer, boolean isProcessingTime, NFACompiler.NFAFactory<IN> nfaFactory, EventComparator<IN> comparator, AfterMatchSkipStrategy afterMatchSkipStrategy, PatternProcessFunction<IN, OUT> function, org.apache.flink.util.OutputTag<IN> lateDataOutputTag) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidinitializeState(org.apache.flink.runtime.state.StateInitializationContext context) voidonEventTime(org.apache.flink.streaming.api.operators.InternalTimer<KEY, org.apache.flink.runtime.state.VoidNamespace> timer) voidonProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<KEY, org.apache.flink.runtime.state.VoidNamespace> timer) voidopen()voidprocessElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) protected voidsetup(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) booleanMethods inherited from class org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator
finish, getUserFunction, getUserFunctionParameters, notifyCheckpointAborted, notifyCheckpointComplete, setOutputType, snapshotStateMethods 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, isAsyncStateProcessingEnabled, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark, processWatermark1, processWatermark1, processWatermark2, processWatermark2, processWatermarkStatus, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, snapshotStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.state.CheckpointListener
notifyCheckpointAborted, notifyCheckpointCompleteMethods inherited from interface org.apache.flink.streaming.api.operators.Input
processLatencyMarker, processRecordAttributes, processWatermark, processWatermark, processWatermarkStatusMethods inherited from interface org.apache.flink.streaming.api.operators.KeyContext
getCurrentKey, setCurrentKeyMethods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler
hasKeyContextMethods inherited from interface org.apache.flink.streaming.api.operators.OneInputStreamOperator
setKeyContextElementMethods inherited from interface org.apache.flink.streaming.api.operators.StreamOperator
finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
-
Constructor Details
-
CepOperator
public CepOperator(org.apache.flink.api.common.typeutils.TypeSerializer<IN> inputSerializer, boolean isProcessingTime, NFACompiler.NFAFactory<IN> nfaFactory, @Nullable EventComparator<IN> comparator, @Nullable AfterMatchSkipStrategy afterMatchSkipStrategy, PatternProcessFunction<IN, OUT> function, @Nullable org.apache.flink.util.OutputTag<IN> lateDataOutputTag)
-
-
Method Details
-
useSplittableTimers
public boolean useSplittableTimers()- Overrides:
useSplittableTimersin classorg.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
-
setup
protected 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:
setupin classorg.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN, OUT>>
-
initializeState
public void initializeState(org.apache.flink.runtime.state.StateInitializationContext context) throws Exception - Specified by:
initializeStatein interfaceorg.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator- Overrides:
initializeStatein classorg.apache.flink.streaming.api.operators.AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN, OUT>> - Throws:
Exception
-
open
-
close
-
processElement
-
onEventTime
-
onProcessingTime
-