Search in sources :

Example 6 with StreamStateElement

use of org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement in project siddhi by wso2.

the class SiddhiQLBaseVisitorImpl method visitLogical_stateful_source.

/**
 * {@inheritDoc}
 * <p>The default implementation returns the result of calling
 * {@link #visitChildren} on {@code ctx}.</p>
 *
 * @param ctx
 */
@Override
public Object visitLogical_stateful_source(@NotNull SiddhiQLParser.Logical_stateful_sourceContext ctx) {
    if (ctx.AND() != null) {
        StreamStateElement streamStateElement1 = (StreamStateElement) visit(ctx.standard_stateful_source(0));
        StreamStateElement streamStateElement2 = (StreamStateElement) visit(ctx.standard_stateful_source(1));
        StateElement stateElement = State.logicalAnd(streamStateElement1, streamStateElement2);
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else if (ctx.OR() != null) {
        StreamStateElement streamStateElement1 = (StreamStateElement) visit(ctx.standard_stateful_source(0));
        StreamStateElement streamStateElement2 = (StreamStateElement) visit(ctx.standard_stateful_source(1));
        StateElement stateElement = State.logicalOr(streamStateElement1, streamStateElement2);
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        throw newSiddhiParserException(ctx);
    }
}
Also used : StreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement) AbsentStreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) 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)

Example 7 with StreamStateElement

use of org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement in project siddhi by wso2.

the class SiddhiQLBaseVisitorImpl method visitBasic_absent_pattern_source.

@Override
public Object visitBasic_absent_pattern_source(SiddhiQLParser.Basic_absent_pattern_sourceContext ctx) {
    // basic_absent_pattern_source
    // :NOT basic_source for_time
    // ;
    AbsentStreamStateElement stateElement = State.logicalNot(new StreamStateElement((BasicSingleInputStream) visit(ctx.basic_source())));
    stateElement.waitingTime((TimeConstant) visit(ctx.for_time()));
    populateQueryContext(stateElement, ctx);
    return stateElement;
}
Also used : StreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement) AbsentStreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) BasicSingleInputStream(org.wso2.siddhi.query.api.execution.query.input.stream.BasicSingleInputStream) AbsentStreamStateElement(org.wso2.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement)

Aggregations

AbsentStreamStateElement (org.wso2.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement)7 StreamStateElement (org.wso2.siddhi.query.api.execution.query.input.state.StreamStateElement)7 CountStateElement (org.wso2.siddhi.query.api.execution.query.input.state.CountStateElement)5 BasicSingleInputStream (org.wso2.siddhi.query.api.execution.query.input.stream.BasicSingleInputStream)4 EveryStateElement (org.wso2.siddhi.query.api.execution.query.input.state.EveryStateElement)3 NextStateElement (org.wso2.siddhi.query.api.execution.query.input.state.NextStateElement)3 StateElement (org.wso2.siddhi.query.api.execution.query.input.state.StateElement)3 AbstractMap (java.util.AbstractMap)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 OperationNotSupportedException (org.wso2.siddhi.core.exception.OperationNotSupportedException)1 EntryValveProcessor (org.wso2.siddhi.core.query.input.stream.single.EntryValveProcessor)1 SingleStreamRuntime (org.wso2.siddhi.core.query.input.stream.single.SingleStreamRuntime)1 AbsentLogicalPostStateProcessor (org.wso2.siddhi.core.query.input.stream.state.AbsentLogicalPostStateProcessor)1 AbsentLogicalPreStateProcessor (org.wso2.siddhi.core.query.input.stream.state.AbsentLogicalPreStateProcessor)1 AbsentStreamPostStateProcessor (org.wso2.siddhi.core.query.input.stream.state.AbsentStreamPostStateProcessor)1 AbsentStreamPreStateProcessor (org.wso2.siddhi.core.query.input.stream.state.AbsentStreamPreStateProcessor)1 CountPostStateProcessor (org.wso2.siddhi.core.query.input.stream.state.CountPostStateProcessor)1 CountPreStateProcessor (org.wso2.siddhi.core.query.input.stream.state.CountPreStateProcessor)1 LogicalPostStateProcessor (org.wso2.siddhi.core.query.input.stream.state.LogicalPostStateProcessor)1