Search in sources :

Example 1 with ValuePartitionExecutor

use of org.ballerinalang.siddhi.core.partition.executor.ValuePartitionExecutor in project ballerina by ballerina-lang.

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.ballerinalang.siddhi.core.partition.executor.ValuePartitionExecutor) RangePartitionType(org.ballerinalang.siddhi.query.api.execution.partition.RangePartitionType) ValuePartitionExecutor(org.ballerinalang.siddhi.core.partition.executor.ValuePartitionExecutor) RangePartitionExecutor(org.ballerinalang.siddhi.core.partition.executor.RangePartitionExecutor) PartitionExecutor(org.ballerinalang.siddhi.core.partition.executor.PartitionExecutor) ArrayList(java.util.ArrayList) RangePartitionExecutor(org.ballerinalang.siddhi.core.partition.executor.RangePartitionExecutor) ValuePartitionType(org.ballerinalang.siddhi.query.api.execution.partition.ValuePartitionType) ConditionExpressionExecutor(org.ballerinalang.siddhi.core.executor.condition.ConditionExpressionExecutor) RangePartitionType(org.ballerinalang.siddhi.query.api.execution.partition.RangePartitionType) ValuePartitionType(org.ballerinalang.siddhi.query.api.execution.partition.ValuePartitionType) PartitionType(org.ballerinalang.siddhi.query.api.execution.partition.PartitionType)

Aggregations

ArrayList (java.util.ArrayList)1 ConditionExpressionExecutor (org.ballerinalang.siddhi.core.executor.condition.ConditionExpressionExecutor)1 PartitionExecutor (org.ballerinalang.siddhi.core.partition.executor.PartitionExecutor)1 RangePartitionExecutor (org.ballerinalang.siddhi.core.partition.executor.RangePartitionExecutor)1 ValuePartitionExecutor (org.ballerinalang.siddhi.core.partition.executor.ValuePartitionExecutor)1 PartitionType (org.ballerinalang.siddhi.query.api.execution.partition.PartitionType)1 RangePartitionType (org.ballerinalang.siddhi.query.api.execution.partition.RangePartitionType)1 ValuePartitionType (org.ballerinalang.siddhi.query.api.execution.partition.ValuePartitionType)1