use of org.wso2.siddhi.core.query.processor.stream.window.TableWindowProcessor in project siddhi by wso2.
the class JoinInputStreamParser method setStreamRuntimeProcessorChain.
private static void setStreamRuntimeProcessorChain(MetaStreamEvent metaStreamEvent, SingleStreamRuntime streamRuntime, String inputStreamId, Map<String, Table> tableMap, Map<String, Window> windowMap, Map<String, AggregationRuntime> aggregationMap, List<VariableExpressionExecutor> variableExpressionExecutors, boolean outputExpectsExpiredEvents, String queryName, Within within, Expression per, SiddhiAppContext siddhiAppContext, InputStream inputStream) {
switch(metaStreamEvent.getEventType()) {
case TABLE:
TableWindowProcessor tableWindowProcessor = new TableWindowProcessor(tableMap.get(inputStreamId));
tableWindowProcessor.initProcessor(metaStreamEvent.getLastInputDefinition(), new ExpressionExecutor[0], null, siddhiAppContext, outputExpectsExpiredEvents, queryName, inputStream);
streamRuntime.setProcessorChain(tableWindowProcessor);
break;
case WINDOW:
WindowWindowProcessor windowWindowProcessor = new WindowWindowProcessor(windowMap.get(inputStreamId));
windowWindowProcessor.initProcessor(metaStreamEvent.getLastInputDefinition(), variableExpressionExecutors.toArray(new ExpressionExecutor[0]), null, siddhiAppContext, outputExpectsExpiredEvents, queryName, inputStream);
streamRuntime.setProcessorChain(windowWindowProcessor);
break;
case AGGREGATE:
AggregationRuntime aggregationRuntime = aggregationMap.get(inputStreamId);
AggregateWindowProcessor aggregateWindowProcessor = new AggregateWindowProcessor(aggregationRuntime, within, per);
aggregateWindowProcessor.initProcessor(metaStreamEvent.getLastInputDefinition(), variableExpressionExecutors.toArray(new ExpressionExecutor[0]), null, siddhiAppContext, outputExpectsExpiredEvents, queryName, inputStream);
streamRuntime.setProcessorChain(aggregateWindowProcessor);
break;
case DEFAULT:
break;
}
}
use of org.wso2.siddhi.core.query.processor.stream.window.TableWindowProcessor in project siddhi by wso2.
the class TableWindowProcessor method cloneProcessor.
@Override
public Processor cloneProcessor(String key) {
try {
TableWindowProcessor streamProcessor = new TableWindowProcessor(table);
streamProcessor.inputDefinition = inputDefinition;
ExpressionExecutor[] innerExpressionExecutors = new ExpressionExecutor[attributeExpressionLength];
ExpressionExecutor[] attributeExpressionExecutors1 = this.attributeExpressionExecutors;
for (int i = 0; i < attributeExpressionLength; i++) {
innerExpressionExecutors[i] = attributeExpressionExecutors1[i].cloneExecutor(key);
}
streamProcessor.attributeExpressionExecutors = innerExpressionExecutors;
streamProcessor.attributeExpressionLength = attributeExpressionLength;
streamProcessor.additionalAttributes = additionalAttributes;
streamProcessor.complexEventPopulater = complexEventPopulater;
streamProcessor.init(inputDefinition, attributeExpressionExecutors, configReader, siddhiAppContext, outputExpectsExpiredEvents);
streamProcessor.start();
return streamProcessor;
} catch (Exception e) {
throw new SiddhiAppRuntimeException("Exception in cloning " + this.getClass().getCanonicalName(), e);
}
}
Aggregations