Search in sources :

Example 1 with WindowWindowProcessor

use of io.siddhi.core.query.processor.stream.window.WindowWindowProcessor 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, Within within, Expression per, List<Variable> queryGroupByList, SiddhiQueryContext siddhiQueryContext, InputStream inputStream) {
    switch(metaStreamEvent.getEventType()) {
        case TABLE:
            TableWindowProcessor tableWindowProcessor = new TableWindowProcessor(tableMap.get(inputStreamId));
            tableWindowProcessor.initProcessor(metaStreamEvent, new ExpressionExecutor[0], null, outputExpectsExpiredEvents, true, false, inputStream, siddhiQueryContext);
            streamRuntime.setProcessorChain(tableWindowProcessor);
            break;
        case WINDOW:
            WindowWindowProcessor windowWindowProcessor = new WindowWindowProcessor(windowMap.get(inputStreamId));
            windowWindowProcessor.initProcessor(metaStreamEvent, variableExpressionExecutors.toArray(new ExpressionExecutor[0]), null, outputExpectsExpiredEvents, true, false, inputStream, siddhiQueryContext);
            streamRuntime.setProcessorChain(windowWindowProcessor);
            break;
        case AGGREGATE:
            AggregationRuntime aggregationRuntime = aggregationMap.get(inputStreamId);
            AggregateWindowProcessor aggregateWindowProcessor = new AggregateWindowProcessor(aggregationRuntime, within, per, queryGroupByList);
            aggregateWindowProcessor.initProcessor(metaStreamEvent, variableExpressionExecutors.toArray(new ExpressionExecutor[0]), null, outputExpectsExpiredEvents, true, false, inputStream, siddhiQueryContext);
            streamRuntime.setProcessorChain(aggregateWindowProcessor);
            break;
        case DEFAULT:
            break;
    }
}
Also used : AggregateWindowProcessor(io.siddhi.core.query.processor.stream.window.AggregateWindowProcessor) TableWindowProcessor(io.siddhi.core.query.processor.stream.window.TableWindowProcessor) VariableExpressionExecutor(io.siddhi.core.executor.VariableExpressionExecutor) ExpressionExecutor(io.siddhi.core.executor.ExpressionExecutor) ConstantExpressionExecutor(io.siddhi.core.executor.ConstantExpressionExecutor) WindowWindowProcessor(io.siddhi.core.query.processor.stream.window.WindowWindowProcessor) AggregationRuntime(io.siddhi.core.aggregation.AggregationRuntime)

Aggregations

AggregationRuntime (io.siddhi.core.aggregation.AggregationRuntime)1 ConstantExpressionExecutor (io.siddhi.core.executor.ConstantExpressionExecutor)1 ExpressionExecutor (io.siddhi.core.executor.ExpressionExecutor)1 VariableExpressionExecutor (io.siddhi.core.executor.VariableExpressionExecutor)1 AggregateWindowProcessor (io.siddhi.core.query.processor.stream.window.AggregateWindowProcessor)1 TableWindowProcessor (io.siddhi.core.query.processor.stream.window.TableWindowProcessor)1 WindowWindowProcessor (io.siddhi.core.query.processor.stream.window.WindowWindowProcessor)1