Package io.siddhi.core.window
Class Window
- java.lang.Object
-
- io.siddhi.core.window.Window
-
- All Implemented Interfaces:
FindableProcessor,MemoryCalculable
public class Window extends Object implements FindableProcessor, MemoryCalculable
Window implementation of SiddhiQL. It can be seen as a global Window which can be accessed from multiple queries.
-
-
Constructor Summary
Constructors Constructor Description Window(io.siddhi.query.api.definition.WindowDefinition windowDefinition, SiddhiAppContext siddhiAppContext)Construct a Window object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ComplexEventChunk complexEventChunk)Add the given ComplexEventChunk to the Window.CompiledConditioncompileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, 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)To find events from the processor event pool, that the matches the matchingEvent based on finder logic.LockWrappergetLock()ProcessingModegetProcessingMode()io.siddhi.query.api.definition.WindowDefinitiongetWindowDefinition()Return theWindowDefinitionused to construct this Window.voidinit(Map<String,Table> tableMap, Map<String,Window> eventWindowMap, String windowName, boolean findToBeExecuted)Initialize the WindowEvent table by creatingWindowProcessorto handle the events.booleanisStateful()voidsetPublisher(StreamJunction.Publisher publisher)Set Publisher to which the the output events from internal window have to be sent.
-
-
-
Constructor Detail
-
Window
public Window(io.siddhi.query.api.definition.WindowDefinition windowDefinition, SiddhiAppContext siddhiAppContext)Construct a Window object.- Parameters:
windowDefinition- definition of the windowsiddhiAppContext- siddhi app context of Siddhi
-
-
Method Detail
-
init
public void init(Map<String,Table> tableMap, Map<String,Window> eventWindowMap, String windowName, boolean findToBeExecuted)
Initialize the WindowEvent table by creatingWindowProcessorto handle the events.- Parameters:
tableMap- map ofTableseventWindowMap- map of EventWindowswindowName- name of the query window belongs to.findToBeExecuted- will find will be executed on the window.
-
setPublisher
public void setPublisher(StreamJunction.Publisher publisher)
Set Publisher to which the the output events from internal window have to be sent.- Parameters:
publisher- output publisher
-
getWindowDefinition
public io.siddhi.query.api.definition.WindowDefinition getWindowDefinition()
Return theWindowDefinitionused to construct this Window.- Returns:
- the window definition
-
add
public void add(ComplexEventChunk complexEventChunk)
Add the given ComplexEventChunk to the Window.- Parameters:
complexEventChunk- the event chunk to be added
-
find
public StreamEvent find(StateEvent matchingEvent, CompiledCondition compiledCondition)
To find events from the processor event pool, that the matches the matchingEvent based on finder logic.- Specified by:
findin interfaceFindableProcessor- 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 Processor- Returns:
- the matched events
-
compileCondition
public CompiledCondition compileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, 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.- Specified by:
compileConditionin interfaceFindableProcessor- Parameters:
condition- the matching conditionmatchingMetaInfoHolder- the meta structure of the incoming matchingEventvariableExpressionExecutors- the list of variable ExpressionExecutors already createdtableMap- map of event tablessiddhiQueryContext- current siddhi query context- Returns:
- compiled Condition having the capability of matching events against the incoming matchingEvent
-
getLock
public LockWrapper getLock()
-
getProcessingMode
public ProcessingMode getProcessingMode()
-
isStateful
public boolean isStateful()
-
-