Class AbstractStreamProcessor<S extends State>

    • Field Detail

      • nextProcessor

        protected Processor nextProcessor
      • inputDefinition

        protected io.siddhi.query.api.definition.AbstractDefinition inputDefinition
      • attributeExpressionExecutors

        protected ExpressionExecutor[] attributeExpressionExecutors
      • attributeExpressionLength

        protected int attributeExpressionLength
    • Constructor Detail

      • AbstractStreamProcessor

        public AbstractStreamProcessor()
    • Method Detail

      • initProcessor

        public void initProcessor​(MetaStreamEvent metaStreamEvent,
                                  ExpressionExecutor[] attributeExpressionExecutors,
                                  ConfigReader configReader,
                                  boolean outputExpectsExpiredEvents,
                                  boolean findToBeExecuted,
                                  boolean groupBy,
                                  io.siddhi.query.api.SiddhiElement siddhiElement,
                                  SiddhiQueryContext siddhiQueryContext)
      • init

        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
        Parameters:
        metaStreamEvent - the stream event meta
        inputDefinition - the incoming stream definition
        attributeExpressionExecutors - the executors of each function parameters
        configReader - this hold the AbstractStreamProcessor extensions configuration
        streamEventClonerHolder - stream event cloner holder
        outputExpectsExpiredEvents - is expired events sent as output
        findToBeExecuted - find will be executed
        siddhiQueryContext - current siddhi query context
      • getReturnAttributes

        public abstract List<io.siddhi.query.api.definition.Attribute> getReturnAttributes()
      • process

        public void process​(ComplexEventChunk streamEventChunk)
        Description copied from interface: Processor
        Process the handed StreamEvent
        Specified by:
        process in interface Processor
        Parameters:
        streamEventChunk - event chunk to be processed
      • process

        public void process​(List<ComplexEventChunk> complexEventChunks)
        Description copied from interface: Processor
        Process the handed StreamEvent
        Specified by:
        process in interface Processor
        Parameters:
        complexEventChunks - event chunks to be processed
      • processEventChunk

        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
        Parameters:
        streamEventChunk - the event chunk that need to be processed
        nextProcessor - the next processor to which the success events need to be passed
        streamEventCloner - helps to clone the incoming event for local storage or modification
        complexEventPopulater - helps to populate the events with the resultant attributes
        state - current state of the processor
      • getNextProcessor

        public Processor getNextProcessor()
        Description copied from interface: Processor
        Get next processor element in the processor chain. Processed event should be sent to next processor
        Specified by:
        getNextProcessor in interface Processor
        Returns:
        next processor
      • setNextProcessor

        public void setNextProcessor​(Processor processor)
        Description copied from interface: Processor
        Set next processor element in processor chain
        Specified by:
        setNextProcessor in interface Processor
        Parameters:
        processor - Processor to be set as next element of processor chain
      • constructStreamEventPopulater

        public void constructStreamEventPopulater​(MetaStreamEvent metaStreamEvent,
                                                  int streamEventChainIndex)
      • setStreamEventCloner

        public void setStreamEventCloner​(StreamEventCloner streamEventCloner)
      • setToLast

        public void setToLast​(Processor processor)
        Description copied from interface: Processor
        Set as the last element of the processor chain
        Specified by:
        setToLast in interface Processor
        Parameters:
        processor - Last processor in the chain
      • getProcessingMode

        public abstract ProcessingMode getProcessingMode()
        Defines the behaviour of the processing, will be called after the init
        Returns:
        ProcessingMode processing mode of the processor
      • isStateful

        public boolean isStateful()