public class StreamPreStateProcessor extends Object implements PreStateProcessor, Snapshotable
| Modifier and Type | Field and Description |
|---|---|
protected ComplexEventChunk<StateEvent> |
currentStateEventChunk |
protected String |
elementId |
protected ExecutionPlanContext |
executionPlanContext |
protected boolean |
isStartState |
protected LinkedList<StateEvent> |
newAndEveryStateEventList |
protected Processor |
nextProcessor |
protected LinkedList<StateEvent> |
pendingStateEventList |
protected String |
queryName |
protected boolean |
stateChanged |
protected StateEventCloner |
stateEventCloner |
protected StateEventPool |
stateEventPool |
protected int |
stateId |
protected org.wso2.siddhi.query.api.execution.query.input.stream.StateInputStream.Type |
stateType |
protected StreamEventCloner |
streamEventCloner |
protected StreamEventPool |
streamEventPool |
protected StreamPostStateProcessor |
thisLastProcessor |
protected StreamPostStateProcessor |
thisStatePostProcessor |
protected List<Map.Entry<Long,Set<Integer>>> |
withinStates |
| Constructor and Description |
|---|
StreamPreStateProcessor(org.wso2.siddhi.query.api.execution.query.input.stream.StateInputStream.Type stateType,
List<Map.Entry<Long,Set<Integer>>> withinStates) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEveryState(StateEvent stateEvent) |
void |
addState(StateEvent stateEvent) |
PreStateProcessor |
cloneProcessor(String key)
Clone a copy of processor
|
protected void |
cloneProperties(StreamPreStateProcessor streamPreStateProcessor,
String key) |
Object[] |
currentState()
Used to collect the serializable state of the processing element, that need to be
persisted for the reconstructing the element to the same state on a different point of time
|
String |
getElementId() |
Processor |
getNextProcessor()
Get next processor element in the processor chain.
|
int |
getStateId() |
StreamPostStateProcessor |
getThisLastProcessor() |
StreamPostStateProcessor |
getThisStatePostProcessor() |
void |
init() |
void |
init(ExecutionPlanContext executionPlanContext,
String queryName) |
void |
process(ComplexEventChunk complexEventChunk)
Process the handed StreamEvent
|
protected void |
process(StateEvent stateEvent) |
ComplexEventChunk<StateEvent> |
processAndReturn(ComplexEventChunk complexEventChunk) |
void |
resetState() |
void |
restoreState(Object[] state)
Used to restore serialized state of the processing element, for reconstructing
the element to the same state as if was on a previous point of time.
|
void |
setNextProcessor(Processor processor)
Set next processor element in processor chain
|
void |
setStartState(boolean isStartState) |
void |
setStateEventCloner(StateEventCloner stateEventCloner) |
void |
setStateEventPool(StateEventPool stateEventPool) |
void |
setStateId(int stateId) |
void |
setStreamEventCloner(StreamEventCloner streamEventCloner) |
void |
setStreamEventPool(StreamEventPool streamEventPool) |
void |
setThisLastProcessor(StreamPostStateProcessor thisLastProcessor) |
void |
setThisStatePostProcessor(StreamPostStateProcessor thisStatePostProcessor) |
void |
setToLast(Processor processor)
Set as the last element of the processor chain
|
void |
stateChanged() |
void |
updateState() |
protected int stateId
protected boolean isStartState
protected volatile boolean stateChanged
protected org.wso2.siddhi.query.api.execution.query.input.stream.StateInputStream.Type stateType
protected ExecutionPlanContext executionPlanContext
protected String elementId
protected StreamPostStateProcessor thisStatePostProcessor
protected StreamPostStateProcessor thisLastProcessor
protected Processor nextProcessor
protected ComplexEventChunk<StateEvent> currentStateEventChunk
protected LinkedList<StateEvent> pendingStateEventList
protected LinkedList<StateEvent> newAndEveryStateEventList
protected StateEventPool stateEventPool
protected StreamEventCloner streamEventCloner
protected StateEventCloner stateEventCloner
protected StreamEventPool streamEventPool
protected String queryName
public void init(ExecutionPlanContext executionPlanContext, String queryName)
public void setThisStatePostProcessor(StreamPostStateProcessor thisStatePostProcessor)
public StreamPostStateProcessor getThisStatePostProcessor()
getThisStatePostProcessor in interface PreStateProcessorpublic void process(ComplexEventChunk complexEventChunk)
protected void process(StateEvent stateEvent)
public Processor getNextProcessor()
getNextProcessor in interface Processorpublic void setNextProcessor(Processor processor)
setNextProcessor in interface Processorprocessor - Processor to be set as next element of processor chainpublic void setToLast(Processor processor)
public void init()
init in interface PreStateProcessorpublic StreamPostStateProcessor getThisLastProcessor()
public void setThisLastProcessor(StreamPostStateProcessor thisLastProcessor)
public PreStateProcessor cloneProcessor(String key)
cloneProcessor in interface PreStateProcessorcloneProcessor in interface Processorkey - partition keyprotected void cloneProperties(StreamPreStateProcessor streamPreStateProcessor, String key)
public void addState(StateEvent stateEvent)
addState in interface PreStateProcessorpublic void addEveryState(StateEvent stateEvent)
addEveryState in interface PreStateProcessorpublic void stateChanged()
public void setStartState(boolean isStartState)
setStartState in interface PreStateProcessorpublic void setStateEventPool(StateEventPool stateEventPool)
public void setStreamEventPool(StreamEventPool streamEventPool)
public void setStreamEventCloner(StreamEventCloner streamEventCloner)
public void setStateEventCloner(StateEventCloner stateEventCloner)
public void resetState()
resetState in interface PreStateProcessorpublic void updateState()
updateState in interface PreStateProcessorpublic void setStateId(int stateId)
setStateId in interface PreStateProcessorpublic ComplexEventChunk<StateEvent> processAndReturn(ComplexEventChunk complexEventChunk)
processAndReturn in interface PreStateProcessorpublic int getStateId()
getStateId in interface PreStateProcessorpublic Object[] currentState()
SnapshotablecurrentState in interface Snapshotablepublic void restoreState(Object[] state)
SnapshotablerestoreState in interface Snapshotablestate - the stateful objects of the element as an array on
the same order provided by currentState().public String getElementId()
getElementId in interface SnapshotableCopyright © 2018 WSO2. All Rights Reserved.