S
- current state of the processorpublic abstract class AbstractStreamProcessor<S extends State> extends Object implements Processor, ExternalReferencedHolder
Processor
intended to be used by any Stream Processors.Modifier and Type | Field and Description |
---|---|
protected ExpressionExecutor[] |
attributeExpressionExecutors |
protected int |
attributeExpressionLength |
protected ComplexEventPopulater |
complexEventPopulater |
protected io.siddhi.query.api.definition.AbstractDefinition |
inputDefinition |
protected MetaStreamEvent |
metaStreamEvent |
protected Processor |
nextProcessor |
protected SiddhiQueryContext |
siddhiQueryContext |
protected StateHolder<S> |
stateHolder |
protected StreamEventClonerHolder |
streamEventClonerHolder |
Constructor and Description |
---|
AbstractStreamProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
constructStreamEventPopulater(MetaStreamEvent metaStreamEvent,
int streamEventChainIndex) |
Processor |
getNextProcessor()
Get next processor element in the processor chain.
|
abstract ProcessingMode |
getProcessingMode()
Defines the behaviour of the processing, will be called after the init
|
abstract List<io.siddhi.query.api.definition.Attribute> |
getReturnAttributes() |
protected abstract StateFactory<S> |
init(MetaStreamEvent metaStreamEvent,
io.siddhi.query.api.definition.AbstractDefinition inputDefinition,
ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader,
StreamEventClonerHolder streamEventClonerHolder,
boolean outputExpectsExpiredEvents,
boolean findToBeExecuted,
SiddhiQueryContext siddhiQueryContext)
The init method of the StreamProcessor, this method will be called before other methods
|
void |
initProcessor(MetaStreamEvent metaStreamEvent,
ExpressionExecutor[] attributeExpressionExecutors,
ConfigReader configReader,
boolean outputExpectsExpiredEvents,
boolean findToBeExecuted,
boolean groupBy,
io.siddhi.query.api.SiddhiElement siddhiElement,
SiddhiQueryContext siddhiQueryContext) |
boolean |
isStateful() |
void |
process(ComplexEventChunk streamEventChunk)
Process the handed StreamEvent
|
void |
process(List<ComplexEventChunk> complexEventChunks)
Process the handed StreamEvent
|
protected abstract void |
processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk,
Processor nextProcessor,
StreamEventCloner streamEventCloner,
ComplexEventPopulater complexEventPopulater,
S state)
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, wait
start, stop
protected Processor nextProcessor
protected MetaStreamEvent metaStreamEvent
protected SiddhiQueryContext siddhiQueryContext
protected StreamEventClonerHolder streamEventClonerHolder
protected io.siddhi.query.api.definition.AbstractDefinition inputDefinition
protected ExpressionExecutor[] attributeExpressionExecutors
protected int attributeExpressionLength
protected ComplexEventPopulater complexEventPopulater
protected StateHolder<S extends State> stateHolder
public void initProcessor(MetaStreamEvent metaStreamEvent, ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, boolean outputExpectsExpiredEvents, boolean findToBeExecuted, boolean groupBy, io.siddhi.query.api.SiddhiElement siddhiElement, SiddhiQueryContext siddhiQueryContext)
protected abstract StateFactory<S> init(MetaStreamEvent metaStreamEvent, io.siddhi.query.api.definition.AbstractDefinition inputDefinition, ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, StreamEventClonerHolder streamEventClonerHolder, boolean outputExpectsExpiredEvents, boolean findToBeExecuted, SiddhiQueryContext siddhiQueryContext)
metaStreamEvent
- the stream event metainputDefinition
- the incoming stream definitionattributeExpressionExecutors
- the executors of each function parametersconfigReader
- this hold the AbstractStreamProcessor
extensions configurationstreamEventClonerHolder
- stream event cloner holderoutputExpectsExpiredEvents
- is expired events sent as outputfindToBeExecuted
- find will be executedsiddhiQueryContext
- current siddhi query contextpublic abstract List<io.siddhi.query.api.definition.Attribute> getReturnAttributes()
public void process(ComplexEventChunk streamEventChunk)
Processor
public void process(List<ComplexEventChunk> complexEventChunks)
Processor
protected abstract void processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner, ComplexEventPopulater complexEventPopulater, S state)
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 attributesstate
- current state of the processorpublic Processor getNextProcessor()
Processor
getNextProcessor
in interface Processor
public void setNextProcessor(Processor processor)
Processor
setNextProcessor
in interface Processor
processor
- Processor to be set as next element of processor chainpublic void constructStreamEventPopulater(MetaStreamEvent metaStreamEvent, int streamEventChainIndex)
public void setStreamEventCloner(StreamEventCloner streamEventCloner)
public void setToLast(Processor processor)
Processor
public abstract ProcessingMode getProcessingMode()
public boolean isStateful()
Copyright © 2019. All rights reserved.