public abstract class AbstractStreamProcessor extends Object implements Processor, EternalReferencedHolder, Snapshotable
Processor intended to be used by any Stream Processors.| Modifier and Type | Field and Description |
|---|---|
protected List<org.wso2.siddhi.query.api.definition.Attribute> |
additionalAttributes |
protected ExpressionExecutor[] |
attributeExpressionExecutors |
protected int |
attributeExpressionLength |
protected ComplexEventPopulater |
complexEventPopulater |
protected String |
elementId |
protected org.wso2.siddhi.query.api.definition.AbstractDefinition |
inputDefinition |
protected Processor |
nextProcessor |
protected String |
queryName |
protected SiddhiAppContext |
siddhiAppContext |
protected StreamEventCloner |
streamEventCloner |
protected StreamEventClonerHolder |
streamEventClonerHolder |
| Constructor and Description |
|---|
AbstractStreamProcessor() |
| Modifier and Type | Method and Description |
|---|---|
Processor |
cloneProcessor(String key)
Clone a copy of processor
|
void |
constructStreamEventPopulater(MetaStreamEvent metaStreamEvent,
int streamEventChainIndex) |
String |
getElementId() |
Processor |
getNextProcessor()
Get next processor element in the processor chain.
|
protected abstract List<org.wso2.siddhi.query.api.definition.Attribute> |
init(org.wso2.siddhi.query.api.definition.AbstractDefinition inputDefinition,
ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader,
SiddhiAppContext siddhiAppContext,
boolean outputExpectsExpiredEvents)
The init method of the StreamProcessor, this method will be called before other methods
|
org.wso2.siddhi.query.api.definition.AbstractDefinition |
initProcessor(org.wso2.siddhi.query.api.definition.AbstractDefinition inputDefinition,
ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader,
SiddhiAppContext siddhiAppContext,
boolean outputExpectsExpiredEvents,
String queryName,
org.wso2.siddhi.query.api.SiddhiElement siddhiElement) |
void |
process(ComplexEventChunk streamEventChunk)
Process the handed StreamEvent
|
protected abstract void |
processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk,
Processor nextProcessor,
StreamEventCloner streamEventCloner,
ComplexEventPopulater complexEventPopulater)
The main processing method that will be called upon event arrival
|
void |
setNextProcessor(Processor processor)
Set next processor element in processor chain
|
void |
setStreamEventCloner(StreamEventCloner streamEventCloner) |
void |
setToLast(Processor processor)
Set as the last element of the processor chain
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstart, stopcurrentState, restoreStateprotected Processor nextProcessor
protected List<org.wso2.siddhi.query.api.definition.Attribute> additionalAttributes
protected StreamEventClonerHolder streamEventClonerHolder
protected StreamEventCloner streamEventCloner
protected org.wso2.siddhi.query.api.definition.AbstractDefinition inputDefinition
protected ExpressionExecutor[] attributeExpressionExecutors
protected SiddhiAppContext siddhiAppContext
protected int attributeExpressionLength
protected ComplexEventPopulater complexEventPopulater
protected String elementId
protected String queryName
public org.wso2.siddhi.query.api.definition.AbstractDefinition initProcessor(org.wso2.siddhi.query.api.definition.AbstractDefinition inputDefinition,
ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader,
SiddhiAppContext siddhiAppContext,
boolean outputExpectsExpiredEvents,
String queryName,
org.wso2.siddhi.query.api.SiddhiElement siddhiElement)
protected abstract List<org.wso2.siddhi.query.api.definition.Attribute> init(org.wso2.siddhi.query.api.definition.AbstractDefinition inputDefinition, ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, SiddhiAppContext siddhiAppContext, boolean outputExpectsExpiredEvents)
inputDefinition - the incoming stream definitionattributeExpressionExecutors - the executors of each function parametersconfigReader - this hold the AbstractStreamProcessor extensions configuration
reader.siddhiAppContext - the context of the siddhi appoutputExpectsExpiredEvents - is output expects ExpiredEvents @return the additional output attributes
introduced by the functionpublic void process(ComplexEventChunk streamEventChunk)
Processorprotected abstract void processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner, ComplexEventPopulater complexEventPopulater)
streamEventChunk - the event chunk that need to be processednextProcessor - the next processor to which the success events need to be passedstreamEventCloner - helps to clone the incoming event for local storage or modificationcomplexEventPopulater - helps to populate the events with the resultant attributespublic Processor getNextProcessor()
ProcessorgetNextProcessor in interface Processorpublic void setNextProcessor(Processor processor)
ProcessorsetNextProcessor in interface Processorprocessor - Processor to be set as next element of processor chainpublic Processor cloneProcessor(String key)
ProcessorcloneProcessor in interface Processorkey - partition keypublic void constructStreamEventPopulater(MetaStreamEvent metaStreamEvent, int streamEventChainIndex)
public void setStreamEventCloner(StreamEventCloner streamEventCloner)
public void setToLast(Processor processor)
Processorpublic String getElementId()
getElementId in interface SnapshotableCopyright © 2018 WSO2. All rights reserved.