IN
- Type of the input elementsOUT
- Type of the output elementspublic abstract class AbstractCEPPatternOperator<IN,OUT> extends AbstractCEPBasePatternOperator<IN,OUT>
NFA
and a priority queue to order out of order
elements in case of event time processing.AbstractStreamOperator.CountingOutput
INITIAL_PRIORITY_QUEUE_CAPACITY
chainingStrategy, LOG, metrics, output
Constructor and Description |
---|
AbstractCEPPatternOperator(TypeSerializer<IN> inputSerializer,
boolean isProcessingTime,
NFACompiler.NFAFactory<IN> nfaFactory) |
Modifier and Type | Method and Description |
---|---|
protected NFA<IN> |
getNFA() |
protected PriorityQueue<StreamRecord<IN>> |
getPriorityQueue() |
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic.
|
void |
processWatermark(Watermark mark)
Processes a
Watermark . |
void |
restoreState(StreamTaskState state)
Restores the operator state, if this operator's execution is recovering from a checkpoint.
|
StreamTaskState |
snapshotOperatorState(long checkpointId,
long timestamp)
Called to draw a state snapshot from the operator.
|
protected void |
updateNFA(NFA<IN> nfa) |
protected void |
updatePriorityQueue(PriorityQueue<StreamRecord<IN>> queue) |
advanceTime, getInputSerializer, processElement, processEvent
close, dispose, getChainingStrategy, getContainingTask, getCurrentProcessingTime, getExecutionConfig, getMetricGroup, getOperatorConfig, getOperatorName, getPartitionedState, getPartitionedState, getRuntimeContext, getStateBackend, getUserCodeClassloader, notifyOfCompletedCheckpoint, registerTimer, setChainingStrategy, setKeyContext, setKeyContextElement1, setKeyContextElement2, setup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, dispose, getChainingStrategy, getMetricGroup, notifyOfCompletedCheckpoint, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup
public AbstractCEPPatternOperator(TypeSerializer<IN> inputSerializer, boolean isProcessingTime, NFACompiler.NFAFactory<IN> nfaFactory)
public void open()
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractStreamOperator<OUT>
protected NFA<IN> getNFA() throws IOException
getNFA
in class AbstractCEPBasePatternOperator<IN,OUT>
IOException
protected void updateNFA(NFA<IN> nfa)
updateNFA
in class AbstractCEPBasePatternOperator<IN,OUT>
protected PriorityQueue<StreamRecord<IN>> getPriorityQueue() throws IOException
getPriorityQueue
in class AbstractCEPBasePatternOperator<IN,OUT>
IOException
protected void updatePriorityQueue(PriorityQueue<StreamRecord<IN>> queue)
updatePriorityQueue
in class AbstractCEPBasePatternOperator<IN,OUT>
public void processWatermark(Watermark mark) throws Exception
OneInputStreamOperator
Watermark
.
This method is guaranteed to not be called concurrently with other methods of the operator.public StreamTaskState snapshotOperatorState(long checkpointId, long timestamp) throws Exception
StreamOperator
snapshotOperatorState
in interface StreamOperator<OUT>
snapshotOperatorState
in class AbstractStreamOperator<OUT>
checkpointId
- The ID of the checkpoint.timestamp
- The timestamp of the checkpoint.Exception
- Forwards exceptions that occur while drawing snapshots from the operator
and the key/value state.public void restoreState(StreamTaskState state) throws Exception
StreamOperator
This method is called after StreamOperator.setup(StreamTask, StreamConfig, Output)
and before StreamOperator.open()
.
restoreState
in interface StreamOperator<OUT>
restoreState
in class AbstractStreamOperator<OUT>
state
- The state of operator that was snapshotted as part of checkpoint
from which the execution is restored.Exception
- Exceptions during state restore should be forwarded, so that the system can
properly react to failed state restore and fail the execution attempt.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.