IN
- Type of the input elementsKEY
- Type of the key on which the input stream is keyedOUT
- Type of the output elements@Internal public class CepOperator<IN,KEY,OUT> extends AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>> implements OneInputStreamOperator<IN,OUT>, Triggerable<KEY,VoidNamespace>
NFA
and a priority queue to buffer out of order elements. Both data structures are stored using the
managed keyed state.userFunction
chainingStrategy, config, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
CepOperator(TypeSerializer<IN> inputSerializer,
boolean isProcessingTime,
NFACompiler.NFAFactory<IN> nfaFactory,
EventComparator<IN> comparator,
AfterMatchSkipStrategy afterMatchSkipStrategy,
PatternProcessFunction<IN,OUT> function,
OutputTag<IN> lateDataOutputTag) |
Modifier and Type | Method and Description |
---|---|
void |
close()
This method is called at the very end of the operator's life, both in the case of a
successful completion of the operation, and in the case of a failure and canceling.
|
void |
initializeState(StateInitializationContext context)
Stream operators with state which can be restored need to override this hook method.
|
void |
onEventTime(InternalTimer<KEY,VoidNamespace> timer)
Invoked when an event-time timer fires.
|
void |
onProcessingTime(InternalTimer<KEY,VoidNamespace> timer)
Invoked when a processing-time timer fires.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g. state initialization.
|
void |
processElement(StreamRecord<IN> element)
Processes one element that arrived on this input of the
MultipleInputStreamOperator . |
void |
setup(StreamTask<?,?> containingTask,
StreamConfig config,
Output<StreamRecord<OUT>> output)
Initializes the operator.
|
finish, getUserFunction, getUserFunctionParameters, notifyCheckpointAborted, notifyCheckpointComplete, setOutputType, snapshotState
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
finish, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
processLatencyMarker, processWatermark, processWatermarkStatus
hasKeyContext
public CepOperator(TypeSerializer<IN> inputSerializer, boolean isProcessingTime, NFACompiler.NFAFactory<IN> nfaFactory, @Nullable EventComparator<IN> comparator, @Nullable AfterMatchSkipStrategy afterMatchSkipStrategy, PatternProcessFunction<IN,OUT> function, @Nullable OutputTag<IN> lateDataOutputTag)
public void setup(StreamTask<?,?> containingTask, StreamConfig config, Output<StreamRecord<OUT>> output)
SetupableStreamOperator
setup
in interface SetupableStreamOperator<OUT>
setup
in class AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
public void initializeState(StateInitializationContext context) throws Exception
AbstractStreamOperator
initializeState
in interface StreamOperatorStateHandler.CheckpointedStreamOperator
initializeState
in class AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
context
- context that allows to register different states.Exception
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
Exception
- An exception in this method causes the operator to fail.public void close() throws Exception
StreamOperator
This method is expected to make a thorough effort to release all resources that the operator has acquired.
NOTE:It can not emit any records! If you need to emit records at the end of
processing, do so in the StreamOperator.finish()
method.
close
in interface StreamOperator<OUT>
close
in class AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
Exception
public void processElement(StreamRecord<IN> element) throws Exception
Input
MultipleInputStreamOperator
.
This method is guaranteed to not be called concurrently with other methods of the operator.processElement
in interface Input<IN>
Exception
public void onEventTime(InternalTimer<KEY,VoidNamespace> timer) throws Exception
Triggerable
onEventTime
in interface Triggerable<KEY,VoidNamespace>
Exception
public void onProcessingTime(InternalTimer<KEY,VoidNamespace> timer) throws Exception
Triggerable
onProcessingTime
in interface Triggerable<KEY,VoidNamespace>
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.