use of org.wso2.siddhi.core.event.stream.StreamEvent in project siddhi by wso2.
the class IncrementalExecutor method dispatchEvents.
private void dispatchEvents(Map<String, BaseIncrementalValueStore> baseIncrementalValueGroupByStore) {
int noOfEvents = baseIncrementalValueGroupByStore.size();
if (noOfEvents > 0) {
ComplexEventChunk<StreamEvent> eventChunk = new ComplexEventChunk<>(true);
for (BaseIncrementalValueStore aBaseIncrementalValueStore : baseIncrementalValueGroupByStore.values()) {
StreamEvent streamEvent = aBaseIncrementalValueStore.createStreamEvent();
eventChunk.add(streamEvent);
}
LOG.debug("Event dispatched by " + this.duration + " incremental executor: " + eventChunk.toString());
table.addEvents(eventChunk, noOfEvents);
if (getNextExecutor() != null) {
next.execute(eventChunk);
}
}
baseIncrementalValueGroupByStore.clear();
}
use of org.wso2.siddhi.core.event.stream.StreamEvent in project siddhi by wso2.
the class IncrementalExecutor method dispatchEvent.
private void dispatchEvent(long startTimeOfNewAggregates, BaseIncrementalValueStore aBaseIncrementalValueStore) {
if (aBaseIncrementalValueStore.isProcessed()) {
StreamEvent streamEvent = aBaseIncrementalValueStore.createStreamEvent();
ComplexEventChunk<StreamEvent> eventChunk = new ComplexEventChunk<>(true);
eventChunk.add(streamEvent);
LOG.debug("Event dispatched by " + this.duration + " incremental executor: " + eventChunk.toString());
table.addEvents(eventChunk, 1);
if (getNextExecutor() != null) {
next.execute(eventChunk);
}
}
cleanBaseIncrementalValueStore(startTimeOfNewAggregates, aBaseIncrementalValueStore);
}
use of org.wso2.siddhi.core.event.stream.StreamEvent in project siddhi by wso2.
the class BaseIncrementalValueStore method createStreamEvent.
public StreamEvent createStreamEvent() {
StreamEvent streamEvent = streamEventPool.borrowEvent();
streamEvent.setTimestamp(timestamp);
setValue(timestamp, 0);
streamEvent.setOutputData(values);
return streamEvent;
}
use of org.wso2.siddhi.core.event.stream.StreamEvent in project siddhi by wso2.
the class ConversionStreamEventChunk method convertAllStreamEvents.
private StreamEvent convertAllStreamEvents(ComplexEvent complexEvents, StreamEvent firstEvent) {
streamEventConverter.convertComplexEvent(complexEvents, firstEvent);
StreamEvent currentEvent = firstEvent;
complexEvents = complexEvents.getNext();
while (complexEvents != null) {
StreamEvent nextEvent = streamEventPool.borrowEvent();
streamEventConverter.convertComplexEvent(complexEvents, nextEvent);
currentEvent.setNext(nextEvent);
currentEvent = nextEvent;
complexEvents = complexEvents.getNext();
}
return currentEvent;
}
use of org.wso2.siddhi.core.event.stream.StreamEvent in project siddhi by wso2.
the class ConversionStreamEventChunk method convertAndAssign.
public void convertAndAssign(Event event) {
StreamEvent borrowedEvent = streamEventPool.borrowEvent();
streamEventConverter.convertEvent(event, borrowedEvent);
first = borrowedEvent;
last = first;
}
Aggregations