Search in sources :

Example 1 with EveryStateElement

use of org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement in project ballerina by ballerina-lang.

the class SiddhiQLBaseVisitorImpl method visitAbsent_pattern_source_chain.

@Override
public Object visitAbsent_pattern_source_chain(SiddhiQLParser.Absent_pattern_source_chainContext ctx) {
    if (ctx.absent_pattern_source_chain() != null) {
        StateElement stateElement = (StateElement) visit(ctx.absent_pattern_source_chain());
        if (ctx.EVERY() != null) {
            stateElement = new EveryStateElement(stateElement);
        }
        if (ctx.within_time() != null) {
            stateElement.setWithin((TimeConstant) visit(ctx.within_time()));
        }
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        return visit(ctx.getChild(0));
    }
}
Also used : EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement) StateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StateElement) AbsentStreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) CountStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.CountStateElement) StreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StreamStateElement) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement)

Example 2 with EveryStateElement

use of org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement in project ballerina by ballerina-lang.

the class SiddhiQLBaseVisitorImpl method visitEvery_absent_sequence_source_chain.

@Override
public Object visitEvery_absent_sequence_source_chain(SiddhiQLParser.Every_absent_sequence_source_chainContext ctx) {
    // every_absent_sequence_source_chain
    // : EVERY? absent_sequence_source_chain  within_time? ',' sequence_source_chain
    // | EVERY? sequence_source  within_time? ',' absent_sequence_source_chain
    // ;
    StateElement stateElement1;
    StateElement stateElement2;
    if (ctx.EVERY() != null) {
        stateElement1 = new EveryStateElement((StateElement) visit(ctx.getChild(1)));
    } else {
        stateElement1 = (StateElement) visit(ctx.getChild(0));
    }
    if (ctx.within_time() != null) {
        stateElement1.setWithin((TimeConstant) visit(ctx.within_time()));
    }
    stateElement2 = (StateElement) visit(ctx.getChild(ctx.getChildCount() - 1));
    populateQueryContext(stateElement1, ctx);
    populateQueryContext(stateElement2, ctx);
    NextStateElement nextStateElement = new NextStateElement(stateElement1, stateElement2);
    populateQueryContext(nextStateElement, ctx);
    StateInputStream stateInputStream = new StateInputStream(StateInputStream.Type.SEQUENCE, nextStateElement);
    populateQueryContext(stateInputStream, ctx);
    return stateInputStream;
}
Also used : NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement) StateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StateElement) AbsentStreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) CountStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.CountStateElement) StreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StreamStateElement) StateInputStream(org.ballerinalang.siddhi.query.api.execution.query.input.stream.StateInputStream) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement)

Example 3 with EveryStateElement

use of org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement in project ballerina by ballerina-lang.

the class SiddhiQLBaseVisitorImpl method visitRight_absent_pattern_source.

@Override
public Object visitRight_absent_pattern_source(SiddhiQLParser.Right_absent_pattern_sourceContext ctx) {
    // ;
    if (ctx.right_absent_pattern_source().size() == 1 && ctx.every_absent_pattern_source() == null && ctx.every_pattern_source_chain() == null) {
        // EVERY? '('right_absent_pattern_source')' within_time?
        StateElement stateElement = (StateElement) visit(ctx.right_absent_pattern_source(0));
        if (ctx.EVERY() != null) {
            stateElement = new EveryStateElement(stateElement);
        }
        if (ctx.within_time() != null) {
            stateElement.setWithin((TimeConstant) visit(ctx.within_time()));
        }
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        NextStateElement nextStateElement = new NextStateElement((StateElement) visit(ctx.getChild(0)), (StateElement) visit(ctx.getChild(2)));
        populateQueryContext(nextStateElement, ctx);
        return nextStateElement;
    }
}
Also used : NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement) StateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StateElement) AbsentStreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) CountStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.CountStateElement) StreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StreamStateElement) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement)

Example 4 with EveryStateElement

use of org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement in project ballerina by ballerina-lang.

the class SiddhiQLBaseVisitorImpl method visitEvery_absent_pattern_source.

@Override
public Object visitEvery_absent_pattern_source(SiddhiQLParser.Every_absent_pattern_sourceContext ctx) {
    // every_absent_pattern_source
    // : EVERY? basic_absent_pattern_source
    // ;
    StateElement stateElement = (StateElement) visit(ctx.basic_absent_pattern_source());
    if (ctx.EVERY() != null) {
        stateElement = new EveryStateElement(stateElement);
    }
    populateQueryContext(stateElement, ctx);
    return stateElement;
}
Also used : EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement) StateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StateElement) AbsentStreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) CountStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.CountStateElement) StreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StreamStateElement) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement)

Example 5 with EveryStateElement

use of org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement in project ballerina by ballerina-lang.

the class SiddhiQLBaseVisitorImpl method visitEvery_sequence_source_chain.

@Override
public Object visitEvery_sequence_source_chain(SiddhiQLParser.Every_sequence_source_chainContext ctx) {
    // every_sequence_source_chain
    // : EVERY? sequence_source  within_time?  ',' sequence_source_chain
    // ;
    StateElement stateElement1;
    if (ctx.EVERY() != null) {
        stateElement1 = new EveryStateElement((StateElement) visit(ctx.sequence_source()));
    } else {
        stateElement1 = (StateElement) visit(ctx.sequence_source());
    }
    if (ctx.within_time() != null) {
        stateElement1.setWithin((TimeConstant) visit(ctx.within_time()));
    }
    populateQueryContext(stateElement1, ctx);
    NextStateElement nextStateElement = new NextStateElement(stateElement1, ((StateElement) visit(ctx.sequence_source_chain())));
    populateQueryContext(nextStateElement, ctx);
    StateInputStream stateInputStream = new StateInputStream(StateInputStream.Type.SEQUENCE, nextStateElement);
    populateQueryContext(stateInputStream, ctx);
    return stateInputStream;
}
Also used : NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement) StateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StateElement) AbsentStreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) NextStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement) CountStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.CountStateElement) StreamStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.StreamStateElement) StateInputStream(org.ballerinalang.siddhi.query.api.execution.query.input.stream.StateInputStream) EveryStateElement(org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement)

Aggregations

AbsentStreamStateElement (org.ballerinalang.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement)8 CountStateElement (org.ballerinalang.siddhi.query.api.execution.query.input.state.CountStateElement)8 EveryStateElement (org.ballerinalang.siddhi.query.api.execution.query.input.state.EveryStateElement)8 NextStateElement (org.ballerinalang.siddhi.query.api.execution.query.input.state.NextStateElement)8 StateElement (org.ballerinalang.siddhi.query.api.execution.query.input.state.StateElement)8 StreamStateElement (org.ballerinalang.siddhi.query.api.execution.query.input.state.StreamStateElement)8 StateInputStream (org.ballerinalang.siddhi.query.api.execution.query.input.stream.StateInputStream)2 AbstractMap (java.util.AbstractMap)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 OperationNotSupportedException (org.ballerinalang.siddhi.core.exception.OperationNotSupportedException)1 EntryValveProcessor (org.ballerinalang.siddhi.core.query.input.stream.single.EntryValveProcessor)1 SingleStreamRuntime (org.ballerinalang.siddhi.core.query.input.stream.single.SingleStreamRuntime)1 AbsentLogicalPostStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.AbsentLogicalPostStateProcessor)1 AbsentLogicalPreStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.AbsentLogicalPreStateProcessor)1 AbsentStreamPostStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.AbsentStreamPostStateProcessor)1 AbsentStreamPreStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.AbsentStreamPreStateProcessor)1 CountPostStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.CountPostStateProcessor)1 CountPreStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.CountPreStateProcessor)1 LogicalPostStateProcessor (org.ballerinalang.siddhi.core.query.input.stream.state.LogicalPostStateProcessor)1