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.AbstractStreamOperator.CountingOutput<OUT>
userFunction
chainingStrategy, config, latencyStats, LOG, metrics, output, timeServiceManager
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 after all records have been added to the operators via the methods
OneInputStreamOperator.processElement(StreamRecord) , or
TwoInputStreamOperator.processElement1(StreamRecord) and
TwoInputStreamOperator.processElement2(StreamRecord) . |
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.
|
void |
processElement(StreamRecord<IN> element)
Processes one element that arrived at this operator.
|
void |
setup(StreamTask<?,?> containingTask,
StreamConfig config,
Output<StreamRecord<OUT>> output)
Initializes the operator.
|
dispose, getUserFunction, getUserFunctionParameters, notifyCheckpointComplete, setOutputType, snapshotState
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getUserCodeClassloader, initializeState, numEventTimeTimers, numProcessingTimeTimers, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLatencyMarker, processWatermark
dispose, getChainingStrategy, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointComplete
getCurrentKey, setCurrentKey
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)
StreamOperator
setup
in interface StreamOperator<OUT>
setup
in class AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
public void initializeState(StateInitializationContext context) throws Exception
AbstractStreamOperator
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
AbstractStreamOperator
OneInputStreamOperator.processElement(StreamRecord)
, or
TwoInputStreamOperator.processElement1(StreamRecord)
and
TwoInputStreamOperator.processElement2(StreamRecord)
.
The method is expected to flush all remaining buffered data. Exceptions during this flushing of buffered should be propagated, in order to cause the operation to be recognized asa failed, because the last data items are not processed properly.
close
in interface StreamOperator<OUT>
close
in class AbstractUdfStreamOperator<OUT,PatternProcessFunction<IN,OUT>>
Exception
- An exception in this method causes the operator to fail.public void processElement(StreamRecord<IN> element) throws Exception
OneInputStreamOperator
processElement
in interface OneInputStreamOperator<IN,OUT>
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–2020 The Apache Software Foundation. All rights reserved.