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, AbstractStreamOperator.LatencyGauge
INITIAL_PRIORITY_QUEUE_CAPACITY
chainingStrategy, config, latencyGauge, 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, e.g.
|
void |
processWatermark(Watermark mark)
Processes a
Watermark . |
void |
restoreState(FSDataInputStream state)
Restores the operator state, if this operator's execution is recovering from a checkpoint.
|
void |
snapshotState(FSDataOutputStream out,
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, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorName, getOperatorStateBackend, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getUserCodeClassloader, initializeState, initializeState, notifyOfCompletedCheckpoint, numEventTimeTimers, numProcessingTimeTimers, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setup, snapshotLegacyOperatorState, snapshotState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLatencyMarker
close, dispose, getChainingStrategy, getMetricGroup, initializeState, notifyOfCompletedCheckpoint, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup, snapshotLegacyOperatorState, snapshotState
public AbstractCEPPatternOperator(TypeSerializer<IN> inputSerializer, boolean isProcessingTime, NFACompiler.NFAFactory<IN> nfaFactory)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractStreamOperator<OUT>
Exception
- An exception in this method causes the operator to fail.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.processWatermark
in interface OneInputStreamOperator<IN,OUT>
processWatermark
in class AbstractStreamOperator<OUT>
Exception
Watermark
public void snapshotState(FSDataOutputStream out, long checkpointId, long timestamp) throws Exception
StreamCheckpointedOperator
out
- The stream to which we have to write our state.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(FSDataInputStream state) throws Exception
CheckpointedRestoringOperator
This method is called after StreamOperator.setup(StreamTask, StreamConfig, Output)
and before StreamOperator.open()
.
state
- The stream from which we have to restore our state.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.