Search in sources :

Example 21 with MatchingMetaInfoHolder

use of org.wso2.siddhi.core.util.collection.operator.MatchingMetaInfoHolder in project siddhi by wso2.

the class AbstractRecordTable method compileUpdateSet.

public CompiledUpdateSet compileUpdateSet(UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, SiddhiAppContext siddhiAppContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, String queryName) {
    RecordTableCompiledUpdateSet recordTableCompiledUpdateSet = new RecordTableCompiledUpdateSet();
    Map<String, ExpressionExecutor> parentExecutorMap = new HashMap<>();
    for (UpdateSet.SetAttribute setAttribute : updateSet.getSetAttributeList()) {
        ExpressionBuilder expressionBuilder = new ExpressionBuilder(setAttribute.getAssignmentExpression(), matchingMetaInfoHolder, siddhiAppContext, variableExpressionExecutors, tableMap, queryName);
        CompiledExpression compiledExpression = compileSetAttribute(expressionBuilder);
        recordTableCompiledUpdateSet.put(setAttribute.getTableVariable().getAttributeName(), compiledExpression);
        Map<String, ExpressionExecutor> expressionExecutorMap = expressionBuilder.getVariableExpressionExecutorMap();
        parentExecutorMap.putAll(expressionExecutorMap);
    }
    recordTableCompiledUpdateSet.setExpressionExecutorMap(parentExecutorMap);
    return recordTableCompiledUpdateSet;
}
Also used : VariableExpressionExecutor(org.wso2.siddhi.core.executor.VariableExpressionExecutor) ExpressionExecutor(org.wso2.siddhi.core.executor.ExpressionExecutor) HashMap(java.util.HashMap) UpdateSet(org.wso2.siddhi.query.api.execution.query.output.stream.UpdateSet) CompiledUpdateSet(org.wso2.siddhi.core.table.CompiledUpdateSet) CompiledExpression(org.wso2.siddhi.core.util.collection.operator.CompiledExpression)

Example 22 with MatchingMetaInfoHolder

use of org.wso2.siddhi.core.util.collection.operator.MatchingMetaInfoHolder in project siddhi by wso2.

the class AbstractRecordTable method compileCondition.

@Override
public CompiledCondition compileCondition(Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, SiddhiAppContext siddhiAppContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String, Table> tableMap, String queryName) {
    ExpressionBuilder expressionBuilder = new ExpressionBuilder(condition, matchingMetaInfoHolder, siddhiAppContext, variableExpressionExecutors, tableMap, queryName);
    CompiledCondition compileCondition = compileCondition(expressionBuilder);
    Map<String, ExpressionExecutor> expressionExecutorMap = expressionBuilder.getVariableExpressionExecutorMap();
    return new RecordStoreCompiledCondition(expressionExecutorMap, compileCondition);
}
Also used : CompiledCondition(org.wso2.siddhi.core.util.collection.operator.CompiledCondition) VariableExpressionExecutor(org.wso2.siddhi.core.executor.VariableExpressionExecutor) ExpressionExecutor(org.wso2.siddhi.core.executor.ExpressionExecutor)

Aggregations

MatchingMetaInfoHolder (org.wso2.siddhi.core.util.collection.operator.MatchingMetaInfoHolder)11 VariableExpressionExecutor (org.wso2.siddhi.core.executor.VariableExpressionExecutor)10 MetaStreamEvent (org.wso2.siddhi.core.event.stream.MetaStreamEvent)9 ExpressionExecutor (org.wso2.siddhi.core.executor.ExpressionExecutor)9 CompiledCondition (org.wso2.siddhi.core.util.collection.operator.CompiledCondition)8 MetaStateEvent (org.wso2.siddhi.core.event.state.MetaStateEvent)7 Attribute (org.wso2.siddhi.query.api.definition.Attribute)7 HashMap (java.util.HashMap)6 SiddhiAppCreationException (org.wso2.siddhi.core.exception.SiddhiAppCreationException)5 Map (java.util.Map)4 ConstantExpressionExecutor (org.wso2.siddhi.core.executor.ConstantExpressionExecutor)4 ArrayList (java.util.ArrayList)3 AndMultiPrimaryKeyCollectionExpression (org.wso2.siddhi.core.util.collection.expression.AndMultiPrimaryKeyCollectionExpression)3 AttributeCollectionExpression (org.wso2.siddhi.core.util.collection.expression.AttributeCollectionExpression)3 CollectionExpression (org.wso2.siddhi.core.util.collection.expression.CollectionExpression)3 CompareCollectionExpression (org.wso2.siddhi.core.util.collection.expression.CompareCollectionExpression)3 Variable (org.wso2.siddhi.query.api.expression.Variable)3 ComplexEventChunk (org.wso2.siddhi.core.event.ComplexEventChunk)2 StateEventPool (org.wso2.siddhi.core.event.state.StateEventPool)2 FindStoreQueryRuntime (org.wso2.siddhi.core.query.FindStoreQueryRuntime)2