Search in sources :

Example 1 with StreamEventPool

use of org.wso2.siddhi.core.event.stream.StreamEventPool in project siddhi by wso2.

the class MultiProcessStreamReceiver method receive.

@Override
public void receive(ComplexEvent complexEvent) {
    ComplexEvent aComplexEvent = complexEvent;
    while (aComplexEvent != null) {
        synchronized (this) {
            stabilizeStates();
            for (int anEventSequence : eventSequence) {
                StreamEventConverter aStreamEventConverter = streamEventConverters[anEventSequence];
                StreamEventPool aStreamEventPool = streamEventPools[anEventSequence];
                StreamEvent borrowedEvent = aStreamEventPool.borrowEvent();
                aStreamEventConverter.convertComplexEvent(aComplexEvent, borrowedEvent);
                process(anEventSequence, borrowedEvent);
            }
        }
        aComplexEvent = aComplexEvent.getNext();
    }
}
Also used : ComplexEvent(org.wso2.siddhi.core.event.ComplexEvent) StreamEventConverter(org.wso2.siddhi.core.event.stream.converter.StreamEventConverter) MetaStreamEvent(org.wso2.siddhi.core.event.stream.MetaStreamEvent) StreamEvent(org.wso2.siddhi.core.event.stream.StreamEvent) StreamEventPool(org.wso2.siddhi.core.event.stream.StreamEventPool)

Example 2 with StreamEventPool

use of org.wso2.siddhi.core.event.stream.StreamEventPool in project siddhi by wso2.

the class AllAggregationGroupByWindowedPerSnapshotOutputRateLimiter method start.

@Override
public void start() {
    scheduler = SchedulerParser.parse(scheduledExecutorService, this, siddhiAppContext);
    scheduler.setStreamEventPool(new StreamEventPool(0, 0, 0, 5));
    scheduler.init(lockWrapper, queryName);
    long currentTime = System.currentTimeMillis();
    scheduledTime = currentTime + value;
    scheduler.notifyAt(scheduledTime);
}
Also used : StreamEventPool(org.wso2.siddhi.core.event.stream.StreamEventPool)

Example 3 with StreamEventPool

use of org.wso2.siddhi.core.event.stream.StreamEventPool in project siddhi by wso2.

the class AllAggregationPerSnapshotOutputRateLimiter method start.

@Override
public void start() {
    scheduler = SchedulerParser.parse(scheduledExecutorService, this, siddhiAppContext);
    scheduler.setStreamEventPool(new StreamEventPool(0, 0, 0, 5));
    scheduler.init(lockWrapper, queryName);
    long currentTime = System.currentTimeMillis();
    scheduledTime = currentTime + value;
    scheduler.notifyAt(scheduledTime);
}
Also used : StreamEventPool(org.wso2.siddhi.core.event.stream.StreamEventPool)

Example 4 with StreamEventPool

use of org.wso2.siddhi.core.event.stream.StreamEventPool in project siddhi by wso2.

the class GroupByPerSnapshotOutputRateLimiter method start.

@Override
public void start() {
    scheduler = SchedulerParser.parse(scheduledExecutorService, this, siddhiAppContext);
    scheduler.setStreamEventPool(new StreamEventPool(0, 0, 0, 5));
    scheduler.init(lockWrapper, queryName);
    long currentTime = System.currentTimeMillis();
    scheduledTime = currentTime + value;
    scheduler.notifyAt(scheduledTime);
}
Also used : StreamEventPool(org.wso2.siddhi.core.event.stream.StreamEventPool)

Example 5 with StreamEventPool

use of org.wso2.siddhi.core.event.stream.StreamEventPool in project siddhi by wso2.

the class WindowedPerSnapshotOutputRateLimiter method start.

@Override
public void start() {
    scheduler = SchedulerParser.parse(scheduledExecutorService, this, siddhiAppContext);
    scheduler.setStreamEventPool(new StreamEventPool(0, 0, 0, 5));
    scheduler.init(lockWrapper, queryName);
    long currentTime = System.currentTimeMillis();
    scheduledTime = currentTime + value;
    scheduler.notifyAt(scheduledTime);
}
Also used : StreamEventPool(org.wso2.siddhi.core.event.stream.StreamEventPool)

Aggregations

StreamEventPool (org.wso2.siddhi.core.event.stream.StreamEventPool)34 StreamEvent (org.wso2.siddhi.core.event.stream.StreamEvent)17 MetaStreamEvent (org.wso2.siddhi.core.event.stream.MetaStreamEvent)15 Test (org.testng.annotations.Test)11 StreamEventConverter (org.wso2.siddhi.core.event.stream.converter.StreamEventConverter)10 Attribute (org.wso2.siddhi.query.api.definition.Attribute)8 ConversionStreamEventChunk (org.wso2.siddhi.core.event.stream.converter.ConversionStreamEventChunk)7 Event (org.wso2.siddhi.core.event.Event)6 MetaStateEvent (org.wso2.siddhi.core.event.state.MetaStateEvent)5 ZeroStreamEventConverter (org.wso2.siddhi.core.event.stream.converter.ZeroStreamEventConverter)5 StreamDefinition (org.wso2.siddhi.query.api.definition.StreamDefinition)5 ComplexEvent (org.wso2.siddhi.core.event.ComplexEvent)4 StreamEventCloner (org.wso2.siddhi.core.event.stream.StreamEventCloner)4 SelectiveStreamEventConverter (org.wso2.siddhi.core.event.stream.converter.SelectiveStreamEventConverter)3 SimpleStreamEventConverter (org.wso2.siddhi.core.event.stream.converter.SimpleStreamEventConverter)3 SiddhiAppCreationException (org.wso2.siddhi.core.exception.SiddhiAppCreationException)3 Table (org.wso2.siddhi.core.table.Table)3 ArrayList (java.util.ArrayList)2 StateEventCloner (org.wso2.siddhi.core.event.state.StateEventCloner)2 StateEventPool (org.wso2.siddhi.core.event.state.StateEventPool)2