Search in sources :

Example 21 with MetaStreamEvent

use of io.siddhi.core.event.stream.MetaStreamEvent in project siddhi by wso2.

the class FindOnDemandQueryRuntime method generateResetComplexEventChunk.

private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
    StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
    streamEvent.setType(ComplexEvent.Type.RESET);
    StateEvent stateEvent = stateEventFactory.newInstance();
    if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
        stateEvent.addEvent(1, streamEvent);
    } else {
        stateEvent.addEvent(0, streamEvent);
    }
    stateEvent.setType(ComplexEvent.Type.RESET);
    ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
    complexEventChunk.add(stateEvent);
    return complexEventChunk;
}
Also used : ComplexEvent(io.siddhi.core.event.ComplexEvent) ComplexEventChunk(io.siddhi.core.event.ComplexEventChunk) StreamEvent(io.siddhi.core.event.stream.StreamEvent) MetaStreamEvent(io.siddhi.core.event.stream.MetaStreamEvent) StateEvent(io.siddhi.core.event.state.StateEvent)

Example 22 with MetaStreamEvent

use of io.siddhi.core.event.stream.MetaStreamEvent in project siddhi by wso2.

the class UpdateOnDemandQueryRuntime method generateResetComplexEventChunk.

private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
    StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
    streamEvent.setType(ComplexEvent.Type.RESET);
    StateEvent stateEvent = stateEventFactory.newInstance();
    stateEvent.addEvent(0, streamEvent);
    stateEvent.setType(ComplexEvent.Type.RESET);
    ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
    complexEventChunk.add(stateEvent);
    return complexEventChunk;
}
Also used : ComplexEvent(io.siddhi.core.event.ComplexEvent) ComplexEventChunk(io.siddhi.core.event.ComplexEventChunk) MetaStreamEvent(io.siddhi.core.event.stream.MetaStreamEvent) StreamEvent(io.siddhi.core.event.stream.StreamEvent) StateEvent(io.siddhi.core.event.state.StateEvent)

Example 23 with MetaStreamEvent

use of io.siddhi.core.event.stream.MetaStreamEvent in project siddhi by wso2.

the class SelectOnDemandQueryRuntime method generateResetComplexEventChunk.

private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
    StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getOutputData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
    streamEvent.setType(ComplexEvent.Type.RESET);
    StateEvent stateEvent = stateEventFactory.newInstance();
    if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
        stateEvent.addEvent(1, streamEvent);
    } else {
        stateEvent.addEvent(0, streamEvent);
    }
    stateEvent.setType(ComplexEvent.Type.RESET);
    ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
    complexEventChunk.add(stateEvent);
    return complexEventChunk;
}
Also used : ComplexEvent(io.siddhi.core.event.ComplexEvent) ComplexEventChunk(io.siddhi.core.event.ComplexEventChunk) StreamEvent(io.siddhi.core.event.stream.StreamEvent) MetaStreamEvent(io.siddhi.core.event.stream.MetaStreamEvent) StateEvent(io.siddhi.core.event.state.StateEvent)

Example 24 with MetaStreamEvent

use of io.siddhi.core.event.stream.MetaStreamEvent in project siddhi by wso2.

the class UpdateOrInsertOnDemandQueryRuntime method generateResetComplexEventChunk.

private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
    StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
    streamEvent.setType(ComplexEvent.Type.RESET);
    StateEvent stateEvent = stateEventFactory.newInstance();
    stateEvent.addEvent(0, streamEvent);
    stateEvent.setType(ComplexEvent.Type.RESET);
    ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
    complexEventChunk.add(stateEvent);
    return complexEventChunk;
}
Also used : ComplexEvent(io.siddhi.core.event.ComplexEvent) ComplexEventChunk(io.siddhi.core.event.ComplexEventChunk) MetaStreamEvent(io.siddhi.core.event.stream.MetaStreamEvent) StreamEvent(io.siddhi.core.event.stream.StreamEvent) StateEvent(io.siddhi.core.event.state.StateEvent)

Example 25 with MetaStreamEvent

use of io.siddhi.core.event.stream.MetaStreamEvent in project siddhi by wso2.

the class DeleteOnDemandQueryRuntime method generateResetComplexEventChunk.

private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
    StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
    streamEvent.setType(ComplexEvent.Type.RESET);
    StateEvent stateEvent = stateEventFactory.newInstance();
    stateEvent.addEvent(0, streamEvent);
    stateEvent.setType(ComplexEvent.Type.RESET);
    ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
    complexEventChunk.add(stateEvent);
    return complexEventChunk;
}
Also used : ComplexEvent(io.siddhi.core.event.ComplexEvent) ComplexEventChunk(io.siddhi.core.event.ComplexEventChunk) MetaStreamEvent(io.siddhi.core.event.stream.MetaStreamEvent) StreamEvent(io.siddhi.core.event.stream.StreamEvent) StateEvent(io.siddhi.core.event.state.StateEvent)

Aggregations

MetaStreamEvent (io.siddhi.core.event.stream.MetaStreamEvent)63 Attribute (io.siddhi.query.api.definition.Attribute)35 MetaStateEvent (io.siddhi.core.event.state.MetaStateEvent)34 StreamEvent (io.siddhi.core.event.stream.StreamEvent)21 StreamEventFactory (io.siddhi.core.event.stream.StreamEventFactory)17 VariableExpressionExecutor (io.siddhi.core.executor.VariableExpressionExecutor)17 ArrayList (java.util.ArrayList)17 StreamEventCloner (io.siddhi.core.event.stream.StreamEventCloner)14 MatchingMetaInfoHolder (io.siddhi.core.util.collection.operator.MatchingMetaInfoHolder)14 Variable (io.siddhi.query.api.expression.Variable)14 SiddhiAppCreationException (io.siddhi.core.exception.SiddhiAppCreationException)13 HashMap (java.util.HashMap)13 AbstractDefinition (io.siddhi.query.api.definition.AbstractDefinition)12 Expression (io.siddhi.query.api.expression.Expression)12 ExpressionExecutor (io.siddhi.core.executor.ExpressionExecutor)10 StreamDefinition (io.siddhi.query.api.definition.StreamDefinition)10 Map (java.util.Map)10 Test (org.testng.annotations.Test)10 ConstantExpressionExecutor (io.siddhi.core.executor.ConstantExpressionExecutor)9 TableDefinition (io.siddhi.query.api.definition.TableDefinition)9