Search in sources :

Example 1 with ValuePartitionExecutor

use of io.siddhi.core.partition.executor.ValuePartitionExecutor 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, SiddhiQueryContext siddhiQueryContext) {
    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, false, 0, ProcessingMode.BATCH, false, siddhiQueryContext)));
                }
            } 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, false, 0, ProcessingMode.BATCH, false, siddhiQueryContext), rangePartitionProperty.getPartitionKey()));
                    }
                }
            }
        }
    }
}
Also used : ValuePartitionExecutor(io.siddhi.core.partition.executor.ValuePartitionExecutor) RangePartitionType(io.siddhi.query.api.execution.partition.RangePartitionType) PartitionExecutor(io.siddhi.core.partition.executor.PartitionExecutor) RangePartitionExecutor(io.siddhi.core.partition.executor.RangePartitionExecutor) ValuePartitionExecutor(io.siddhi.core.partition.executor.ValuePartitionExecutor) ArrayList(java.util.ArrayList) RangePartitionExecutor(io.siddhi.core.partition.executor.RangePartitionExecutor) ValuePartitionType(io.siddhi.query.api.execution.partition.ValuePartitionType) ConditionExpressionExecutor(io.siddhi.core.executor.condition.ConditionExpressionExecutor) PartitionType(io.siddhi.query.api.execution.partition.PartitionType) ValuePartitionType(io.siddhi.query.api.execution.partition.ValuePartitionType) RangePartitionType(io.siddhi.query.api.execution.partition.RangePartitionType)

Aggregations

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