Search in sources :

Example 1 with Table

use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.

the class StreamPartitioner method createSingleInputStreamExecutors.

private void createSingleInputStreamExecutors(SingleInputStream inputStream, Partition partition, MetaStreamEvent metaEvent, List<VariableExpressionExecutor> executors, Map<String, Table> tableMap, SiddhiAppContext siddhiAppContext, String queryName) {
    List<PartitionExecutor> executorList = new ArrayList<PartitionExecutor>();
    partitionExecutorLists.add(executorList);
    if (!inputStream.isInnerStream()) {
        for (PartitionType partitionType : partition.getPartitionTypeMap().values()) {
            if (partitionType instanceof ValuePartitionType) {
                if (partitionType.getStreamId().equals(inputStream.getStreamId())) {
                    executorList.add(new ValuePartitionExecutor(ExpressionParser.parseExpression(((ValuePartitionType) partitionType).getExpression(), metaEvent, SiddhiConstants.UNKNOWN_STATE, tableMap, executors, siddhiAppContext, false, 0, queryName)));
                }
            } else {
                for (RangePartitionType.RangePartitionProperty rangePartitionProperty : ((RangePartitionType) partitionType).getRangePartitionProperties()) {
                    if (partitionType.getStreamId().equals(inputStream.getStreamId())) {
                        executorList.add(new RangePartitionExecutor((ConditionExpressionExecutor) ExpressionParser.parseExpression(rangePartitionProperty.getCondition(), metaEvent, SiddhiConstants.UNKNOWN_STATE, tableMap, executors, siddhiAppContext, false, 0, queryName), rangePartitionProperty.getPartitionKey()));
                    }
                }
            }
        }
    }
}
Also used : ValuePartitionExecutor(org.wso2.siddhi.core.partition.executor.ValuePartitionExecutor) RangePartitionType(org.wso2.siddhi.query.api.execution.partition.RangePartitionType) RangePartitionExecutor(org.wso2.siddhi.core.partition.executor.RangePartitionExecutor) ValuePartitionExecutor(org.wso2.siddhi.core.partition.executor.ValuePartitionExecutor) PartitionExecutor(org.wso2.siddhi.core.partition.executor.PartitionExecutor) ArrayList(java.util.ArrayList) RangePartitionExecutor(org.wso2.siddhi.core.partition.executor.RangePartitionExecutor) ValuePartitionType(org.wso2.siddhi.query.api.execution.partition.ValuePartitionType) ConditionExpressionExecutor(org.wso2.siddhi.core.executor.condition.ConditionExpressionExecutor) PartitionType(org.wso2.siddhi.query.api.execution.partition.PartitionType) RangePartitionType(org.wso2.siddhi.query.api.execution.partition.RangePartitionType) ValuePartitionType(org.wso2.siddhi.query.api.execution.partition.ValuePartitionType)

Example 2 with Table

use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.

the class AbstractQueryableRecordTable method compileSelection.

public CompiledSelection compileSelection(Selector selector, List<Attribute> expectedOutputAttributes, MatchingMetaInfoHolder matchingMetaInfoHolder, SiddhiAppContext siddhiAppContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, String queryName) {
    List<OutputAttribute> outputAttributes = selector.getSelectionList();
    if (outputAttributes.size() == 0) {
        MetaStreamEvent metaStreamEvent = matchingMetaInfoHolder.getMetaStateEvent().getMetaStreamEvent(matchingMetaInfoHolder.getStoreEventIndex());
        List<Attribute> attributeList = metaStreamEvent.getLastInputDefinition().getAttributeList();
        for (Attribute attribute : attributeList) {
            outputAttributes.add(new OutputAttribute(new Variable(attribute.getName())));
        }
    }
    List<SelectAttributeBuilder> selectAttributeBuilders = new ArrayList<>(outputAttributes.size());
    for (OutputAttribute outputAttribute : outputAttributes) {
        ExpressionBuilder expressionBuilder = new ExpressionBuilder(outputAttribute.getExpression(), matchingMetaInfoHolder, siddhiAppContext, variableExpressionExecutors, tableMap, queryName);
        selectAttributeBuilders.add(new SelectAttributeBuilder(expressionBuilder, outputAttribute.getRename()));
    }
    List<ExpressionBuilder> groupByExpressionBuilders = null;
    if (selector.getGroupByList().size() != 0) {
        groupByExpressionBuilders = new ArrayList<>(outputAttributes.size());
        for (Variable variable : selector.getGroupByList()) {
            groupByExpressionBuilders.add(new ExpressionBuilder(variable, matchingMetaInfoHolder, siddhiAppContext, variableExpressionExecutors, tableMap, queryName));
        }
    }
    ExpressionBuilder havingExpressionBuilder = null;
    if (selector.getHavingExpression() != null) {
        havingExpressionBuilder = new ExpressionBuilder(selector.getHavingExpression(), matchingMetaInfoHolder, siddhiAppContext, variableExpressionExecutors, tableMap, queryName);
    }
    List<OrderByAttributeBuilder> orderByAttributeBuilders = null;
    if (selector.getOrderByList().size() != 0) {
        orderByAttributeBuilders = new ArrayList<>(selector.getOrderByList().size());
        for (OrderByAttribute orderByAttribute : selector.getOrderByList()) {
            ExpressionBuilder expressionBuilder = new ExpressionBuilder(orderByAttribute.getVariable(), matchingMetaInfoHolder, siddhiAppContext, variableExpressionExecutors, tableMap, queryName);
            orderByAttributeBuilders.add(new OrderByAttributeBuilder(expressionBuilder, orderByAttribute.getOrder()));
        }
    }
    Long limit = null;
    if (selector.getLimit() != null) {
        ExpressionExecutor expressionExecutor = ExpressionParser.parseExpression((Expression) selector.getLimit(), matchingMetaInfoHolder.getMetaStateEvent(), SiddhiConstants.HAVING_STATE, tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
        limit = ((Number) (((ConstantExpressionExecutor) expressionExecutor).getValue())).longValue();
    }
    CompiledSelection compiledSelection = compileSelection(selectAttributeBuilders, groupByExpressionBuilders, havingExpressionBuilder, orderByAttributeBuilders, limit);
    Map<String, ExpressionExecutor> expressionExecutorMap = new HashMap<>();
    if (selectAttributeBuilders.size() != 0) {
        for (SelectAttributeBuilder selectAttributeBuilder : selectAttributeBuilders) {
            expressionExecutorMap.putAll(selectAttributeBuilder.getExpressionBuilder().getVariableExpressionExecutorMap());
        }
    }
    if (groupByExpressionBuilders != null && groupByExpressionBuilders.size() != 0) {
        for (ExpressionBuilder groupByExpressionBuilder : groupByExpressionBuilders) {
            expressionExecutorMap.putAll(groupByExpressionBuilder.getVariableExpressionExecutorMap());
        }
    }
    if (havingExpressionBuilder != null) {
        expressionExecutorMap.putAll(havingExpressionBuilder.getVariableExpressionExecutorMap());
    }
    if (orderByAttributeBuilders != null && orderByAttributeBuilders.size() != 0) {
        for (OrderByAttributeBuilder orderByAttributeBuilder : orderByAttributeBuilders) {
            expressionExecutorMap.putAll(orderByAttributeBuilder.getExpressionBuilder().getVariableExpressionExecutorMap());
        }
    }
    return new RecordStoreCompiledSelection(expressionExecutorMap, compiledSelection);
}
Also used : Variable(org.wso2.siddhi.query.api.expression.Variable) VariableExpressionExecutor(org.wso2.siddhi.core.executor.VariableExpressionExecutor) ExpressionExecutor(org.wso2.siddhi.core.executor.ExpressionExecutor) ConstantExpressionExecutor(org.wso2.siddhi.core.executor.ConstantExpressionExecutor) Attribute(org.wso2.siddhi.query.api.definition.Attribute) OrderByAttribute(org.wso2.siddhi.query.api.execution.query.selection.OrderByAttribute) OutputAttribute(org.wso2.siddhi.query.api.execution.query.selection.OutputAttribute) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) OutputAttribute(org.wso2.siddhi.query.api.execution.query.selection.OutputAttribute) CompiledSelection(org.wso2.siddhi.core.util.collection.operator.CompiledSelection) OrderByAttribute(org.wso2.siddhi.query.api.execution.query.selection.OrderByAttribute) MetaStreamEvent(org.wso2.siddhi.core.event.stream.MetaStreamEvent)

Example 3 with Table

use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.

the class AggregationParser method getFinalBaseAggregators.

private static List<Expression> getFinalBaseAggregators(SiddhiAppContext siddhiAppContext, Map<String, Table> tableMap, List<VariableExpressionExecutor> incomingVariableExpressionExecutors, String aggregatorName, MetaStreamEvent incomingMetaStreamEvent, List<ExpressionExecutor> incomingExpressionExecutors, List<IncrementalAttributeAggregator> incrementalAttributeAggregators) {
    List<Attribute> finalBaseAttributes = new ArrayList<>();
    List<Expression> finalBaseAggregators = new ArrayList<>();
    for (IncrementalAttributeAggregator incrementalAttributeAggregator : incrementalAttributeAggregators) {
        Attribute[] baseAttributes = incrementalAttributeAggregator.getBaseAttributes();
        Expression[] baseAttributeInitialValues = incrementalAttributeAggregator.getBaseAttributeInitialValues();
        Expression[] baseAggregators = incrementalAttributeAggregator.getBaseAggregators();
        for (int i = 0; i < baseAttributes.length; i++) {
            validateBaseAggregators(incrementalAttributeAggregators, incrementalAttributeAggregator, baseAttributes, baseAttributeInitialValues, baseAggregators, i);
            if (!finalBaseAttributes.contains(baseAttributes[i])) {
                finalBaseAttributes.add(baseAttributes[i]);
                finalBaseAggregators.add(baseAggregators[i]);
                incomingMetaStreamEvent.addOutputData(baseAttributes[i]);
                incomingExpressionExecutors.add(ExpressionParser.parseExpression(baseAttributeInitialValues[i], incomingMetaStreamEvent, 0, tableMap, incomingVariableExpressionExecutors, siddhiAppContext, false, 0, aggregatorName));
            }
        }
    }
    return finalBaseAggregators;
}
Also used : OutputAttribute(org.wso2.siddhi.query.api.execution.query.selection.OutputAttribute) Attribute(org.wso2.siddhi.query.api.definition.Attribute) Expression(org.wso2.siddhi.query.api.expression.Expression) IncrementalAttributeAggregator(org.wso2.siddhi.core.query.selector.attribute.aggregator.incremental.IncrementalAttributeAggregator) ArrayList(java.util.ArrayList)

Example 4 with Table

use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.

the class AggregationParser method parse.

public static AggregationRuntime parse(AggregationDefinition aggregationDefinition, SiddhiAppContext siddhiAppContext, Map<String, AbstractDefinition> streamDefinitionMap, Map<String, AbstractDefinition> tableDefinitionMap, Map<String, AbstractDefinition> windowDefinitionMap, Map<String, AbstractDefinition> aggregationDefinitionMap, Map<String, Table> tableMap, Map<String, Window> windowMap, Map<String, AggregationRuntime> aggregationMap, SiddhiAppRuntimeBuilder siddhiAppRuntimeBuilder) {
    if (aggregationDefinition == null) {
        throw new SiddhiAppCreationException("AggregationDefinition instance is null. " + "Hence, can't create the siddhi app '" + siddhiAppContext.getName() + "'");
    }
    if (aggregationDefinition.getTimePeriod() == null) {
        throw new SiddhiAppCreationException("AggregationDefinition '" + aggregationDefinition.getId() + "'s timePeriod is null. " + "Hence, can't create the siddhi app '" + siddhiAppContext.getName() + "'", aggregationDefinition.getQueryContextStartIndex(), aggregationDefinition.getQueryContextEndIndex());
    }
    if (aggregationDefinition.getSelector() == null) {
        throw new SiddhiAppCreationException("AggregationDefinition '" + aggregationDefinition.getId() + "'s selection is not defined. " + "Hence, can't create the siddhi app '" + siddhiAppContext.getName() + "'", aggregationDefinition.getQueryContextStartIndex(), aggregationDefinition.getQueryContextEndIndex());
    }
    if (streamDefinitionMap.get(aggregationDefinition.getBasicSingleInputStream().getStreamId()) == null) {
        throw new SiddhiAppCreationException("Stream " + aggregationDefinition.getBasicSingleInputStream().getStreamId() + " has not been defined");
    }
    try {
        List<VariableExpressionExecutor> incomingVariableExpressionExecutors = new ArrayList<>();
        String aggregatorName = aggregationDefinition.getId();
        StreamRuntime streamRuntime = InputStreamParser.parse(aggregationDefinition.getBasicSingleInputStream(), siddhiAppContext, streamDefinitionMap, tableDefinitionMap, windowDefinitionMap, aggregationDefinitionMap, tableMap, windowMap, aggregationMap, incomingVariableExpressionExecutors, null, false, aggregatorName);
        // Get original meta for later use.
        MetaStreamEvent incomingMetaStreamEvent = (MetaStreamEvent) streamRuntime.getMetaComplexEvent();
        // Create new meta stream event.
        // This must hold the timestamp, group by attributes (if given) and the incremental attributes, in
        // onAfterWindowData array
        // Example format: AGG_TIMESTAMP, groupByAttribute1, groupByAttribute2, AGG_incAttribute1, AGG_incAttribute2
        // AGG_incAttribute1, AGG_incAttribute2 would have the same attribute names as in
        // finalListOfIncrementalAttributes
        // To enter data as onAfterWindowData
        incomingMetaStreamEvent.initializeAfterWindowData();
        List<ExpressionExecutor> incomingExpressionExecutors = new ArrayList<>();
        List<IncrementalAttributeAggregator> incrementalAttributeAggregators = new ArrayList<>();
        List<Variable> groupByVariableList = aggregationDefinition.getSelector().getGroupByList();
        boolean isProcessingOnExternalTime = aggregationDefinition.getAggregateAttribute() != null;
        // Expressions to get
        List<Expression> outputExpressions = new ArrayList<>();
        // final aggregate outputs. e.g avg = sum/count
        // Expression executors to get
        List<ExpressionExecutor> outputExpressionExecutors = new ArrayList<>();
        // final aggregate outputs. e.g avg = sum/count
        populateIncomingAggregatorsAndExecutors(aggregationDefinition, siddhiAppContext, tableMap, incomingVariableExpressionExecutors, aggregatorName, incomingMetaStreamEvent, incomingExpressionExecutors, incrementalAttributeAggregators, groupByVariableList, outputExpressions);
        int baseAggregatorBeginIndex = incomingMetaStreamEvent.getOutputData().size();
        List<Expression> finalBaseAggregators = getFinalBaseAggregators(siddhiAppContext, tableMap, incomingVariableExpressionExecutors, aggregatorName, incomingMetaStreamEvent, incomingExpressionExecutors, incrementalAttributeAggregators);
        StreamDefinition incomingOutputStreamDefinition = StreamDefinition.id("");
        incomingOutputStreamDefinition.setQueryContextStartIndex(aggregationDefinition.getQueryContextStartIndex());
        incomingOutputStreamDefinition.setQueryContextEndIndex(aggregationDefinition.getQueryContextEndIndex());
        MetaStreamEvent processedMetaStreamEvent = new MetaStreamEvent();
        for (Attribute attribute : incomingMetaStreamEvent.getOutputData()) {
            incomingOutputStreamDefinition.attribute(attribute.getName(), attribute.getType());
            processedMetaStreamEvent.addOutputData(attribute);
        }
        incomingMetaStreamEvent.setOutputDefinition(incomingOutputStreamDefinition);
        processedMetaStreamEvent.addInputDefinition(incomingOutputStreamDefinition);
        processedMetaStreamEvent.setOutputDefinition(incomingOutputStreamDefinition);
        // Executors of processing meta
        List<VariableExpressionExecutor> processVariableExpressionExecutors = new ArrayList<>();
        boolean groupBy = aggregationDefinition.getSelector().getGroupByList().size() != 0;
        List<ExpressionExecutor> processExpressionExecutors = constructProcessExpressionExecutors(siddhiAppContext, tableMap, aggregatorName, baseAggregatorBeginIndex, finalBaseAggregators, incomingOutputStreamDefinition, processedMetaStreamEvent, processVariableExpressionExecutors, groupBy);
        outputExpressionExecutors.addAll(outputExpressions.stream().map(expression -> ExpressionParser.parseExpression(expression, processedMetaStreamEvent, 0, tableMap, processVariableExpressionExecutors, siddhiAppContext, groupBy, 0, aggregatorName)).collect(Collectors.toList()));
        // Create group by key generator
        GroupByKeyGenerator groupByKeyGenerator = null;
        if (groupBy) {
            groupByKeyGenerator = new GroupByKeyGenerator(groupByVariableList, processedMetaStreamEvent, SiddhiConstants.UNKNOWN_STATE, tableMap, processVariableExpressionExecutors, siddhiAppContext, aggregatorName);
        }
        // Create new scheduler
        EntryValveExecutor entryValveExecutor = new EntryValveExecutor(siddhiAppContext);
        LockWrapper lockWrapper = new LockWrapper(aggregatorName);
        lockWrapper.setLock(new ReentrantLock());
        Scheduler scheduler = SchedulerParser.parse(siddhiAppContext.getScheduledExecutorService(), entryValveExecutor, siddhiAppContext);
        scheduler.init(lockWrapper, aggregatorName);
        scheduler.setStreamEventPool(new StreamEventPool(processedMetaStreamEvent, 10));
        QueryParserHelper.reduceMetaComplexEvent(incomingMetaStreamEvent);
        QueryParserHelper.reduceMetaComplexEvent(processedMetaStreamEvent);
        QueryParserHelper.updateVariablePosition(incomingMetaStreamEvent, incomingVariableExpressionExecutors);
        QueryParserHelper.updateVariablePosition(processedMetaStreamEvent, processVariableExpressionExecutors);
        List<TimePeriod.Duration> incrementalDurations = getSortedPeriods(aggregationDefinition.getTimePeriod());
        Map<TimePeriod.Duration, Table> aggregationTables = initDefaultTables(aggregatorName, incrementalDurations, processedMetaStreamEvent.getOutputStreamDefinition(), siddhiAppRuntimeBuilder, aggregationDefinition.getAnnotations(), groupByVariableList);
        int bufferSize = 0;
        Element element = AnnotationHelper.getAnnotationElement(SiddhiConstants.ANNOTATION_BUFFER_SIZE, null, aggregationDefinition.getAnnotations());
        if (element != null) {
            try {
                bufferSize = Integer.parseInt(element.getValue());
            } catch (NumberFormatException e) {
                throw new SiddhiAppCreationException(e.getMessage() + ": BufferSize must be an integer");
            }
        }
        if (bufferSize > 0) {
            TimePeriod.Duration rootDuration = incrementalDurations.get(0);
            if (rootDuration == TimePeriod.Duration.MONTHS || rootDuration == TimePeriod.Duration.YEARS) {
                throw new SiddhiAppCreationException("A buffer size greater than 0 can be provided, only when the " + "first duration value is seconds, minutes, hours or days");
            }
            if (!isProcessingOnExternalTime) {
                throw new SiddhiAppCreationException("Buffer size cannot be specified when events are aggregated " + "based on event arrival time.");
            // Buffer size is used to process out of order events. However, events would never be out of
            // order if they are processed based on event arrival time.
            }
        } else if (bufferSize < 0) {
            throw new SiddhiAppCreationException("Expected a positive integer as the buffer size, but found " + bufferSize + " as the provided value");
        }
        boolean ignoreEventsOlderThanBuffer = false;
        element = AnnotationHelper.getAnnotationElement(SiddhiConstants.ANNOTATION_IGNORE_EVENTS_OLDER_THAN_BUFFER, null, aggregationDefinition.getAnnotations());
        if (element != null) {
            if (element.getValue().equalsIgnoreCase("true")) {
                ignoreEventsOlderThanBuffer = true;
            } else if (!element.getValue().equalsIgnoreCase("false")) {
                throw new SiddhiAppCreationException("IgnoreEventsOlderThanBuffer value must " + "be true or false");
            }
        }
        Map<TimePeriod.Duration, IncrementalExecutor> incrementalExecutorMap = buildIncrementalExecutors(isProcessingOnExternalTime, processedMetaStreamEvent, processExpressionExecutors, groupByKeyGenerator, bufferSize, ignoreEventsOlderThanBuffer, incrementalDurations, aggregationTables, siddhiAppContext, aggregatorName);
        // Recreate in-memory data from tables
        RecreateInMemoryData recreateInMemoryData = new RecreateInMemoryData(incrementalDurations, aggregationTables, incrementalExecutorMap, siddhiAppContext, processedMetaStreamEvent, tableMap, windowMap, aggregationMap);
        IncrementalExecutor rootIncrementalExecutor = incrementalExecutorMap.get(incrementalDurations.get(0));
        rootIncrementalExecutor.setScheduler(scheduler);
        // Connect entry valve to root incremental executor
        entryValveExecutor.setNextExecutor(rootIncrementalExecutor);
        QueryParserHelper.initStreamRuntime(streamRuntime, incomingMetaStreamEvent, lockWrapper, aggregatorName);
        LatencyTracker latencyTrackerFind = null;
        LatencyTracker latencyTrackerInsert = null;
        ThroughputTracker throughputTrackerFind = null;
        ThroughputTracker throughputTrackerInsert = null;
        if (siddhiAppContext.getStatisticsManager() != null) {
            latencyTrackerFind = QueryParserHelper.createLatencyTracker(siddhiAppContext, aggregationDefinition.getId(), SiddhiConstants.METRIC_INFIX_WINDOWS, SiddhiConstants.METRIC_TYPE_FIND);
            latencyTrackerInsert = QueryParserHelper.createLatencyTracker(siddhiAppContext, aggregationDefinition.getId(), SiddhiConstants.METRIC_INFIX_WINDOWS, SiddhiConstants.METRIC_TYPE_INSERT);
            throughputTrackerFind = QueryParserHelper.createThroughputTracker(siddhiAppContext, aggregationDefinition.getId(), SiddhiConstants.METRIC_INFIX_WINDOWS, SiddhiConstants.METRIC_TYPE_FIND);
            throughputTrackerInsert = QueryParserHelper.createThroughputTracker(siddhiAppContext, aggregationDefinition.getId(), SiddhiConstants.METRIC_INFIX_WINDOWS, SiddhiConstants.METRIC_TYPE_INSERT);
        }
        streamRuntime.setCommonProcessor(new IncrementalAggregationProcessor(rootIncrementalExecutor, incomingExpressionExecutors, processedMetaStreamEvent, latencyTrackerInsert, throughputTrackerInsert, siddhiAppContext));
        List<ExpressionExecutor> baseExecutors = cloneExpressionExecutors(processExpressionExecutors);
        ExpressionExecutor timestampExecutor = baseExecutors.remove(0);
        return new AggregationRuntime(aggregationDefinition, incrementalExecutorMap, aggregationTables, ((SingleStreamRuntime) streamRuntime), entryValveExecutor, incrementalDurations, siddhiAppContext, baseExecutors, timestampExecutor, processedMetaStreamEvent, outputExpressionExecutors, latencyTrackerFind, throughputTrackerFind, recreateInMemoryData);
    } catch (Throwable t) {
        ExceptionUtil.populateQueryContext(t, aggregationDefinition, siddhiAppContext);
        throw t;
    }
}
Also used : Variable(org.wso2.siddhi.query.api.expression.Variable) OutputAttribute(org.wso2.siddhi.query.api.execution.query.selection.OutputAttribute) Attribute(org.wso2.siddhi.query.api.definition.Attribute) Scheduler(org.wso2.siddhi.core.util.Scheduler) GroupByKeyGenerator(org.wso2.siddhi.core.query.selector.GroupByKeyGenerator) Element(org.wso2.siddhi.query.api.annotation.Element) ArrayList(java.util.ArrayList) IncrementalExecutor(org.wso2.siddhi.core.aggregation.IncrementalExecutor) StreamEventPool(org.wso2.siddhi.core.event.stream.StreamEventPool) StreamRuntime(org.wso2.siddhi.core.query.input.stream.StreamRuntime) SingleStreamRuntime(org.wso2.siddhi.core.query.input.stream.single.SingleStreamRuntime) IncrementalAggregationProcessor(org.wso2.siddhi.core.aggregation.IncrementalAggregationProcessor) AggregationRuntime(org.wso2.siddhi.core.aggregation.AggregationRuntime) ReentrantLock(java.util.concurrent.locks.ReentrantLock) ThroughputTracker(org.wso2.siddhi.core.util.statistics.ThroughputTracker) Table(org.wso2.siddhi.core.table.Table) VariableExpressionExecutor(org.wso2.siddhi.core.executor.VariableExpressionExecutor) ExpressionExecutor(org.wso2.siddhi.core.executor.ExpressionExecutor) StreamDefinition(org.wso2.siddhi.query.api.definition.StreamDefinition) SiddhiAppCreationException(org.wso2.siddhi.core.exception.SiddhiAppCreationException) TimePeriod(org.wso2.siddhi.query.api.aggregation.TimePeriod) SingleStreamRuntime(org.wso2.siddhi.core.query.input.stream.single.SingleStreamRuntime) VariableExpressionExecutor(org.wso2.siddhi.core.executor.VariableExpressionExecutor) EntryValveExecutor(org.wso2.siddhi.core.query.input.stream.single.EntryValveExecutor) LockWrapper(org.wso2.siddhi.core.util.lock.LockWrapper) Expression(org.wso2.siddhi.query.api.expression.Expression) IncrementalAttributeAggregator(org.wso2.siddhi.core.query.selector.attribute.aggregator.incremental.IncrementalAttributeAggregator) RecreateInMemoryData(org.wso2.siddhi.core.aggregation.RecreateInMemoryData) LatencyTracker(org.wso2.siddhi.core.util.statistics.LatencyTracker) MetaStreamEvent(org.wso2.siddhi.core.event.stream.MetaStreamEvent)

Example 5 with Table

use of org.wso2.siddhi.core.table.Table in project siddhi by wso2.

the class CollectionExpressionParser method buildCollectionExecutor.

public static CollectionExecutor buildCollectionExecutor(CollectionExpression collectionExpression, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, SiddhiAppContext siddhiAppContext, boolean isFirst, String queryName) {
    if (collectionExpression instanceof AttributeCollectionExpression) {
        ExpressionExecutor expressionExecutor = null;
        if (isFirst) {
            expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
        }
        return new CompareCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex(), ((AttributeCollectionExpression) collectionExpression).getAttribute(), Compare.Operator.EQUAL, new ConstantExpressionExecutor(true, Attribute.Type.BOOL));
    } else if (collectionExpression instanceof CompareCollectionExpression) {
        ExpressionExecutor valueExpressionExecutor = ExpressionParser.parseExpression(((CompareCollectionExpression) collectionExpression).getValueCollectionExpression().getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
        AttributeCollectionExpression attributeCollectionExpression = ((AttributeCollectionExpression) ((CompareCollectionExpression) collectionExpression).getAttributeCollectionExpression());
        ExpressionExecutor expressionExecutor = null;
        if (isFirst) {
            expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
        }
        return new CompareCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex(), attributeCollectionExpression.getAttribute(), ((CompareCollectionExpression) collectionExpression).getOperator(), valueExpressionExecutor);
    } else if (collectionExpression instanceof NullCollectionExpression) {
        ExpressionExecutor expressionExecutor = null;
        if (isFirst) {
            expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
        }
        return new CompareCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex(), ((NullCollectionExpression) collectionExpression).getAttribute(), Compare.Operator.EQUAL, new ConstantExpressionExecutor(null, Attribute.Type.OBJECT));
    } else if (collectionExpression instanceof AndMultiPrimaryKeyCollectionExpression) {
        Map<String, ExpressionExecutor> multiPrimaryKeyExpressionExecutors = buildMultiPrimaryKeyExpressionExecutors(collectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, queryName);
        List<Attribute> attributes = matchingMetaInfoHolder.getStoreDefinition().getAttributeList();
        StringBuilder compositePrimaryKey = new StringBuilder();
        List<ExpressionExecutor> sortedExecutors = new ArrayList<ExpressionExecutor>();
        for (Attribute attribute : attributes) {
            ExpressionExecutor expressionExecutor = multiPrimaryKeyExpressionExecutors.get(attribute.getName());
            if (expressionExecutor != null) {
                sortedExecutors.add(expressionExecutor);
                compositePrimaryKey.append(attribute.getName()).append(SiddhiConstants.KEY_DELIMITER);
            }
        }
        return new AndMultiPrimaryKeyCollectionExecutor(compositePrimaryKey.toString(), sortedExecutors);
    } else if (collectionExpression instanceof AndCollectionExpression) {
        CollectionExpression leftCollectionExpression = ((AndCollectionExpression) collectionExpression).getLeftCollectionExpression();
        CollectionExpression rightCollectionExpression = ((AndCollectionExpression) collectionExpression).getRightCollectionExpression();
        ExpressionExecutor expressionExecutor = null;
        CollectionExecutor aCollectionExecutor = null;
        ExhaustiveCollectionExecutor exhaustiveCollectionExecutor = null;
        CollectionExecutor leftCollectionExecutor;
        CollectionExecutor rightCollectionExecutor;
        switch(leftCollectionExpression.getCollectionScope()) {
            case NON:
                switch(rightCollectionExpression.getCollectionScope()) {
                    case NON:
                        expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                        return new NonCollectionExecutor(expressionExecutor);
                    case INDEXED_ATTRIBUTE:
                    case INDEXED_RESULT_SET:
                    case PRIMARY_KEY_ATTRIBUTE:
                    case PRIMARY_KEY_RESULT_SET:
                    case PARTIAL_PRIMARY_KEY_RESULT_SET:
                    case OPTIMISED_PRIMARY_KEY_OR_INDEXED_RESULT_SET:
                    case EXHAUSTIVE:
                        expressionExecutor = ExpressionParser.parseExpression(leftCollectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                        aCollectionExecutor = buildCollectionExecutor(rightCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        return new NonAndCollectionExecutor(expressionExecutor, aCollectionExecutor, rightCollectionExpression.getCollectionScope());
                }
                break;
            case INDEXED_ATTRIBUTE:
            case PRIMARY_KEY_ATTRIBUTE:
                switch(rightCollectionExpression.getCollectionScope()) {
                    case NON:
                        expressionExecutor = ExpressionParser.parseExpression(rightCollectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                        aCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        return new NonAndCollectionExecutor(expressionExecutor, aCollectionExecutor, rightCollectionExpression.getCollectionScope());
                    case INDEXED_ATTRIBUTE:
                    case INDEXED_RESULT_SET:
                    case PRIMARY_KEY_ATTRIBUTE:
                    case PRIMARY_KEY_RESULT_SET:
                    case OPTIMISED_PRIMARY_KEY_OR_INDEXED_RESULT_SET:
                        exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                        leftCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, false, queryName);
                        rightCollectionExecutor = buildCollectionExecutor(rightCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, false, queryName);
                        return new AnyAndCollectionExecutor(leftCollectionExecutor, rightCollectionExecutor, exhaustiveCollectionExecutor);
                    case PARTIAL_PRIMARY_KEY_RESULT_SET:
                    case EXHAUSTIVE:
                        leftCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        if (isFirst || leftCollectionExecutor.getDefaultCost() == CollectionExecutor.Cost.SINGLE_RETURN_INDEX_MATCHING) {
                            exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                        }
                        return new CompareExhaustiveAndCollectionExecutor(leftCollectionExecutor, exhaustiveCollectionExecutor);
                }
                break;
            case INDEXED_RESULT_SET:
            case PRIMARY_KEY_RESULT_SET:
            case OPTIMISED_PRIMARY_KEY_OR_INDEXED_RESULT_SET:
                switch(rightCollectionExpression.getCollectionScope()) {
                    case NON:
                        expressionExecutor = ExpressionParser.parseExpression(rightCollectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                        aCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        return new NonAndCollectionExecutor(expressionExecutor, aCollectionExecutor, rightCollectionExpression.getCollectionScope());
                    case INDEXED_ATTRIBUTE:
                    case PRIMARY_KEY_ATTRIBUTE:
                        exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                        leftCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, false, queryName);
                        rightCollectionExecutor = buildCollectionExecutor(rightCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, false, queryName);
                        return new AnyAndCollectionExecutor(rightCollectionExecutor, leftCollectionExecutor, exhaustiveCollectionExecutor);
                    case INDEXED_RESULT_SET:
                    case PRIMARY_KEY_RESULT_SET:
                    case OPTIMISED_PRIMARY_KEY_OR_INDEXED_RESULT_SET:
                        exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                        leftCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, false, queryName);
                        rightCollectionExecutor = buildCollectionExecutor(rightCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, false, queryName);
                        return new AnyAndCollectionExecutor(leftCollectionExecutor, rightCollectionExecutor, exhaustiveCollectionExecutor);
                    case PARTIAL_PRIMARY_KEY_RESULT_SET:
                    case EXHAUSTIVE:
                        leftCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        if (isFirst || leftCollectionExecutor.getDefaultCost() == CollectionExecutor.Cost.SINGLE_RETURN_INDEX_MATCHING) {
                            exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                        }
                        return new CompareExhaustiveAndCollectionExecutor(leftCollectionExecutor, exhaustiveCollectionExecutor);
                }
                break;
            case PARTIAL_PRIMARY_KEY_RESULT_SET:
            case EXHAUSTIVE:
                switch(rightCollectionExpression.getCollectionScope()) {
                    case NON:
                        expressionExecutor = ExpressionParser.parseExpression(rightCollectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                        aCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        return new NonAndCollectionExecutor(expressionExecutor, aCollectionExecutor, rightCollectionExpression.getCollectionScope());
                    case INDEXED_ATTRIBUTE:
                    case INDEXED_RESULT_SET:
                    case PRIMARY_KEY_ATTRIBUTE:
                    case PRIMARY_KEY_RESULT_SET:
                    case OPTIMISED_PRIMARY_KEY_OR_INDEXED_RESULT_SET:
                        rightCollectionExecutor = buildCollectionExecutor(rightCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                        if (isFirst || rightCollectionExecutor.getDefaultCost() == CollectionExecutor.Cost.SINGLE_RETURN_INDEX_MATCHING) {
                            exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                        }
                        return new CompareExhaustiveAndCollectionExecutor(rightCollectionExecutor, exhaustiveCollectionExecutor);
                    case PARTIAL_PRIMARY_KEY_RESULT_SET:
                    case EXHAUSTIVE:
                        if (isFirst) {
                            expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                        }
                        return new ExhaustiveCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex());
                }
                break;
        }
    } else if (collectionExpression instanceof OrCollectionExpression) {
        CollectionExpression leftCollectionExpression = ((OrCollectionExpression) collectionExpression).getLeftCollectionExpression();
        CollectionExpression rightCollectionExpression = ((OrCollectionExpression) collectionExpression).getRightCollectionExpression();
        ExpressionExecutor expressionExecutor = null;
        CollectionExecutor aCollectionExecutor = null;
        CollectionExecutor leftCollectionExecutor;
        CollectionExecutor rightCollectionExecutor;
        if (leftCollectionExpression.getCollectionScope() == NON && rightCollectionExpression.getCollectionScope() == NON) {
            expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
            return new NonCollectionExecutor(expressionExecutor);
        } else if ((leftCollectionExpression.getCollectionScope() == EXHAUSTIVE && leftCollectionExpression.getCollectionScope() == PARTIAL_PRIMARY_KEY_RESULT_SET) || (rightCollectionExpression.getCollectionScope() == EXHAUSTIVE && rightCollectionExpression.getCollectionScope() == PARTIAL_PRIMARY_KEY_RESULT_SET)) {
            if (isFirst) {
                expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
            }
            return new ExhaustiveCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex());
        } else {
            if (isFirst) {
                aCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
            }
            leftCollectionExecutor = buildCollectionExecutor(leftCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
            rightCollectionExecutor = buildCollectionExecutor(rightCollectionExpression, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
            return new OrCollectionExecutor(leftCollectionExecutor, rightCollectionExecutor, aCollectionExecutor);
        }
    } else if (collectionExpression instanceof NotCollectionExpression) {
        ExpressionExecutor expressionExecutor = null;
        switch(collectionExpression.getCollectionScope()) {
            case NON:
                expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                return new NonCollectionExecutor(expressionExecutor);
            case INDEXED_ATTRIBUTE:
            case INDEXED_RESULT_SET:
            case PRIMARY_KEY_ATTRIBUTE:
            case PRIMARY_KEY_RESULT_SET:
            case OPTIMISED_PRIMARY_KEY_OR_INDEXED_RESULT_SET:
                ExhaustiveCollectionExecutor exhaustiveCollectionExecutor = null;
                if (isFirst) {
                    exhaustiveCollectionExecutor = new ExhaustiveCollectionExecutor(ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName), matchingMetaInfoHolder.getStoreEventIndex());
                }
                CollectionExecutor notCollectionExecutor = buildCollectionExecutor(((NotCollectionExpression) collectionExpression).getCollectionExpression(), matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiAppContext, isFirst, queryName);
                return new NotCollectionExecutor(notCollectionExecutor, exhaustiveCollectionExecutor);
            case PARTIAL_PRIMARY_KEY_RESULT_SET:
            case EXHAUSTIVE:
                if (isFirst) {
                    expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
                }
                return new ExhaustiveCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex());
        }
    } else {
        // Basic
        ExpressionExecutor expressionExecutor = null;
        if (collectionExpression.getCollectionScope() == NON) {
            expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
            return new NonCollectionExecutor(expressionExecutor);
        } else {
            // EXHAUSTIVE
            if (isFirst) {
                expressionExecutor = ExpressionParser.parseExpression(collectionExpression.getExpression(), matchingMetaInfoHolder.getMetaStateEvent(), matchingMetaInfoHolder.getCurrentState(), tableMap, variableExpressionExecutors, siddhiAppContext, false, 0, queryName);
            }
            return new ExhaustiveCollectionExecutor(expressionExecutor, matchingMetaInfoHolder.getStoreEventIndex());
        }
    }
    throw new UnsupportedOperationException(collectionExpression.getClass().getName() + " not supported!");
}
Also used : Attribute(org.wso2.siddhi.query.api.definition.Attribute) AttributeCollectionExpression(org.wso2.siddhi.core.util.collection.expression.AttributeCollectionExpression) CompareCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.CompareCollectionExecutor) ConstantExpressionExecutor(org.wso2.siddhi.core.executor.ConstantExpressionExecutor) CompareExhaustiveAndCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.CompareExhaustiveAndCollectionExecutor) AndCollectionExpression(org.wso2.siddhi.core.util.collection.expression.AndCollectionExpression) NullCollectionExpression(org.wso2.siddhi.core.util.collection.expression.NullCollectionExpression) List(java.util.List) ArrayList(java.util.ArrayList) NotCollectionExpression(org.wso2.siddhi.core.util.collection.expression.NotCollectionExpression) AndCollectionExpression(org.wso2.siddhi.core.util.collection.expression.AndCollectionExpression) BasicCollectionExpression(org.wso2.siddhi.core.util.collection.expression.BasicCollectionExpression) CompareCollectionExpression(org.wso2.siddhi.core.util.collection.expression.CompareCollectionExpression) CollectionExpression(org.wso2.siddhi.core.util.collection.expression.CollectionExpression) OrCollectionExpression(org.wso2.siddhi.core.util.collection.expression.OrCollectionExpression) AttributeCollectionExpression(org.wso2.siddhi.core.util.collection.expression.AttributeCollectionExpression) AndMultiPrimaryKeyCollectionExpression(org.wso2.siddhi.core.util.collection.expression.AndMultiPrimaryKeyCollectionExpression) NullCollectionExpression(org.wso2.siddhi.core.util.collection.expression.NullCollectionExpression) NonCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.NonCollectionExecutor) VariableExpressionExecutor(org.wso2.siddhi.core.executor.VariableExpressionExecutor) ConstantExpressionExecutor(org.wso2.siddhi.core.executor.ConstantExpressionExecutor) ExpressionExecutor(org.wso2.siddhi.core.executor.ExpressionExecutor) ExhaustiveCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.ExhaustiveCollectionExecutor) NotCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.NotCollectionExecutor) AndMultiPrimaryKeyCollectionExpression(org.wso2.siddhi.core.util.collection.expression.AndMultiPrimaryKeyCollectionExpression) AndMultiPrimaryKeyCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.AndMultiPrimaryKeyCollectionExecutor) OrCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.OrCollectionExecutor) NonAndCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.NonAndCollectionExecutor) CompareCollectionExpression(org.wso2.siddhi.core.util.collection.expression.CompareCollectionExpression) OrCollectionExpression(org.wso2.siddhi.core.util.collection.expression.OrCollectionExpression) ExhaustiveCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.ExhaustiveCollectionExecutor) OrCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.OrCollectionExecutor) AndMultiPrimaryKeyCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.AndMultiPrimaryKeyCollectionExecutor) NonAndCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.NonAndCollectionExecutor) CompareExhaustiveAndCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.CompareExhaustiveAndCollectionExecutor) CollectionExecutor(org.wso2.siddhi.core.util.collection.executor.CollectionExecutor) NotCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.NotCollectionExecutor) NonCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.NonCollectionExecutor) CompareCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.CompareCollectionExecutor) AnyAndCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.AnyAndCollectionExecutor) Map(java.util.Map) HashMap(java.util.HashMap) AnyAndCollectionExecutor(org.wso2.siddhi.core.util.collection.executor.AnyAndCollectionExecutor) NotCollectionExpression(org.wso2.siddhi.core.util.collection.expression.NotCollectionExpression)

Aggregations

Test (org.testng.annotations.Test)183 SiddhiAppRuntime (org.wso2.siddhi.core.SiddhiAppRuntime)176 SiddhiManager (org.wso2.siddhi.core.SiddhiManager)176 InputHandler (org.wso2.siddhi.core.stream.input.InputHandler)140 Event (org.wso2.siddhi.core.event.Event)119 QueryCallback (org.wso2.siddhi.core.query.output.callback.QueryCallback)102 ArrayList (java.util.ArrayList)47 VariableExpressionExecutor (org.wso2.siddhi.core.executor.VariableExpressionExecutor)23 HashMap (java.util.HashMap)22 MetaStreamEvent (org.wso2.siddhi.core.event.stream.MetaStreamEvent)20 ExpressionExecutor (org.wso2.siddhi.core.executor.ExpressionExecutor)19 Attribute (org.wso2.siddhi.query.api.definition.Attribute)19 Table (org.wso2.siddhi.core.table.Table)11 Expression (org.wso2.siddhi.query.api.expression.Expression)11 Variable (org.wso2.siddhi.query.api.expression.Variable)11 MetaStateEvent (org.wso2.siddhi.core.event.state.MetaStateEvent)10 SiddhiAppCreationException (org.wso2.siddhi.core.exception.SiddhiAppCreationException)10 TableDefinition (org.wso2.siddhi.query.api.definition.TableDefinition)9 APIMgtDAOException (org.wso2.carbon.apimgt.core.exception.APIMgtDAOException)8 ConstantExpressionExecutor (org.wso2.siddhi.core.executor.ConstantExpressionExecutor)8