Class SessionWindowProcessor
- java.lang.Object
-
- io.siddhi.core.query.processor.stream.AbstractStreamProcessor<S>
-
- io.siddhi.core.query.processor.stream.window.WindowProcessor<S>
-
- io.siddhi.core.query.processor.stream.window.GroupingWindowProcessor<S>
-
- io.siddhi.core.query.processor.stream.window.GroupingFindableWindowProcessor<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState>
-
- io.siddhi.core.query.processor.stream.window.SessionWindowProcessor
-
- All Implemented Interfaces:
Processor,SchedulingProcessor,FindableProcessor,ExternalReferencedHolder
public class SessionWindowProcessor extends GroupingFindableWindowProcessor<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState> implements SchedulingProcessor
Implementation ofWindowProcessorwhich represent a Window operating based on a session.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSessionWindowProcessor.SessionComplexEventChunk<E extends ComplexEvent>Collection used to manage session windows.-
Nested classes/interfaces inherited from class io.siddhi.core.query.processor.stream.window.GroupingWindowProcessor
GroupingWindowProcessor.GroupingKeyPopulator
-
-
Field Summary
-
Fields inherited from class io.siddhi.core.query.processor.stream.window.GroupingWindowProcessor
groupingKeyPopulator, internalAttributes
-
Fields inherited from class io.siddhi.core.query.processor.stream.AbstractStreamProcessor
attributeExpressionExecutors, attributeExpressionLength, complexEventPopulater, inputDefinition, metaStreamEvent, nextProcessor, siddhiQueryContext, stateHolder, streamEventClonerHolder
-
-
Constructor Summary
Constructors Constructor Description SessionWindowProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompiledConditioncompileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState state, SiddhiQueryContext siddhiQueryContext)To construct a finder having the capability of finding events at the processor that corresponds to the incoming matchingEvent and the given matching expression logic.StreamEventfind(StateEvent matchingEvent, CompiledCondition compiledCondition, StreamEventCloner streamEventCloner, io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState state)To find events from the processor event pool, that the matches the matchingEvent based on finder logic.SchedulergetScheduler()protected StateFactory<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState>init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, boolean outputExpectsExpiredEvents, SiddhiQueryContext siddhiQueryContext)The init method of the WindowProcessor, this method will be called before other methodsprotected voidprocessEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner, GroupingWindowProcessor.GroupingKeyPopulator groupingKeyPopulater, io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState state)The main processing method that will be called upon event arrivalvoidsetScheduler(Scheduler scheduler)voidstart()This will be called only once and this can be used to acquire required resources for the processing element.voidstop()This will be called only once and this can be used to release the acquired resources for processing.-
Methods inherited from class io.siddhi.core.query.processor.stream.window.GroupingFindableWindowProcessor
compileCondition, find
-
Methods inherited from class io.siddhi.core.query.processor.stream.window.GroupingWindowProcessor
constructStreamEventPopulater, getProcessingMode, init, processEventChunk
-
Methods inherited from class io.siddhi.core.query.processor.stream.window.WindowProcessor
getReturnAttributes
-
Methods inherited from class io.siddhi.core.query.processor.stream.AbstractStreamProcessor
getNextProcessor, initProcessor, isStateful, process, process, setNextProcessor, setStreamEventCloner, setToLast
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.siddhi.core.query.processor.Processor
getNextProcessor, process, process, setNextProcessor, setToLast
-
-
-
-
Method Detail
-
getScheduler
public Scheduler getScheduler()
- Specified by:
getSchedulerin interfaceSchedulingProcessor
-
setScheduler
public void setScheduler(Scheduler scheduler)
- Specified by:
setSchedulerin interfaceSchedulingProcessor
-
init
protected StateFactory<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState> init(ExpressionExecutor[] attributeExpressionExecutors, ConfigReader configReader, boolean outputExpectsExpiredEvents, SiddhiQueryContext siddhiQueryContext)
Description copied from class:GroupingWindowProcessorThe init method of the WindowProcessor, this method will be called before other methods- Specified by:
initin classGroupingWindowProcessor<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState>- Parameters:
attributeExpressionExecutors- the executors of each function parametersconfigReader- the config reader of windowoutputExpectsExpiredEvents- is expired events sent as outputsiddhiQueryContext- the context of the siddhi query
-
processEventChunk
protected void processEventChunk(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner, GroupingWindowProcessor.GroupingKeyPopulator groupingKeyPopulater, io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState state)
Description copied from class:GroupingWindowProcessorThe main processing method that will be called upon event arrival- Specified by:
processEventChunkin classGroupingWindowProcessor<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState>- Parameters:
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 modificationgroupingKeyPopulater- helps to populate the events with the grouping keystate- current state of the processor
-
start
public void start()
Description copied from interface:ExternalReferencedHolderThis will be called only once and this can be used to acquire required resources for the processing element. This will be called after initializing the system and before starting to process the events.- Specified by:
startin interfaceExternalReferencedHolder
-
stop
public void stop()
Description copied from interface:ExternalReferencedHolderThis will be called only once and this can be used to release the acquired resources for processing. This will be called before shutting down the system.- Specified by:
stopin interfaceExternalReferencedHolder
-
compileCondition
public CompiledCondition compileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState state, SiddhiQueryContext siddhiQueryContext)
Description copied from class:GroupingFindableWindowProcessorTo construct a finder having the capability of finding events at the processor that corresponds to the incoming matchingEvent and the given matching expression logic.- Specified by:
compileConditionin classGroupingFindableWindowProcessor<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState>- Parameters:
condition- the matching conditionmatchingMetaInfoHolder- the meta structure of the incoming matchingEventvariableExpressionExecutors- the list of variable ExpressionExecutors already createdtableMap- map of event tablesstate- current query statesiddhiQueryContext- current siddhi query context- Returns:
- compiled Condition having the capability of matching events against the incoming matchingEvent
-
find
public StreamEvent find(StateEvent matchingEvent, CompiledCondition compiledCondition, StreamEventCloner streamEventCloner, io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState state)
Description copied from class:GroupingFindableWindowProcessorTo find events from the processor event pool, that the matches the matchingEvent based on finder logic.- Specified by:
findin classGroupingFindableWindowProcessor<io.siddhi.core.query.processor.stream.window.SessionWindowProcessor.WindowState>- Parameters:
matchingEvent- the event to be matched with the events at the processorcompiledCondition- the execution element responsible for matching the corresponding events that matches the matchingEvent based on pool of events at ProcessorstreamEventCloner- stream event clonerstate- current query state @return the matched events
-
-