Search in sources :

Example 26 with TimeConstant

use of org.wso2.siddhi.query.api.expression.constant.TimeConstant in project siddhi by wso2.

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.wso2.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(org.wso2.siddhi.query.api.execution.query.input.state.EveryStateElement) StreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement) NextStateElement(org.wso2.siddhi.query.api.execution.query.input.state.NextStateElement) StateElement(org.wso2.siddhi.query.api.execution.query.input.state.StateElement) CountStateElement(org.wso2.siddhi.query.api.execution.query.input.state.CountStateElement) AbsentStreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) EveryStateElement(org.wso2.siddhi.query.api.execution.query.input.state.EveryStateElement)

Aggregations

TimeConstant (org.wso2.siddhi.query.api.expression.constant.TimeConstant)15 AbsentStreamStateElement (org.wso2.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement)12 StreamStateElement (org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement)12 CountStateElement (org.wso2.siddhi.query.api.execution.query.input.state.CountStateElement)11 EveryStateElement (org.wso2.siddhi.query.api.execution.query.input.state.EveryStateElement)11 NextStateElement (org.wso2.siddhi.query.api.execution.query.input.state.NextStateElement)11 StateElement (org.wso2.siddhi.query.api.execution.query.input.state.StateElement)11 Test (org.testng.annotations.Test)2 Query (org.wso2.siddhi.query.api.execution.query.Query)2 StateInputStream (org.wso2.siddhi.query.api.execution.query.input.stream.StateInputStream)2 ANTLRInputStream (org.antlr.v4.runtime.ANTLRInputStream)1 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)1 ParseTree (org.antlr.v4.runtime.tree.ParseTree)1 PartitionType (org.wso2.siddhi.query.api.execution.partition.PartitionType)1 RangePartitionType (org.wso2.siddhi.query.api.execution.partition.RangePartitionType)1 ValuePartitionType (org.wso2.siddhi.query.api.execution.partition.ValuePartitionType)1 BasicSingleInputStream (org.wso2.siddhi.query.api.execution.query.input.stream.BasicSingleInputStream)1 EventOutputRate (org.wso2.siddhi.query.api.execution.query.output.ratelimit.EventOutputRate)1 OutputRate (org.wso2.siddhi.query.api.execution.query.output.ratelimit.OutputRate)1 SnapshotOutputRate (org.wso2.siddhi.query.api.execution.query.output.ratelimit.SnapshotOutputRate)1