use of org.ballerinalang.siddhi.core.executor.incremental.IncrementalUnixTimeFunctionExecutor in project ballerina by ballerina-lang.
the class IncrementalAggregationProcessor method process.
@Override
public void process(ComplexEventChunk complexEventChunk) {
ComplexEventChunk<StreamEvent> streamEventChunk = new ComplexEventChunk<>(complexEventChunk.isBatch());
try {
int noOfEvents = 0;
if (latencyTrackerInsert != null && siddhiAppContext.isStatsEnabled()) {
latencyTrackerInsert.markIn();
}
while (complexEventChunk.hasNext()) {
ComplexEvent complexEvent = complexEventChunk.next();
StreamEvent borrowedEvent = streamEventPool.borrowEvent();
for (int i = 0; i < incomingExpressionExecutors.size(); i++) {
ExpressionExecutor expressionExecutor = incomingExpressionExecutors.get(i);
Object outputData = expressionExecutor.execute(complexEvent);
if (expressionExecutor instanceof IncrementalUnixTimeFunctionExecutor && outputData == null) {
throw new SiddhiAppRuntimeException("Cannot retrieve the timestamp of event");
}
borrowedEvent.setOutputData(outputData, i);
}
streamEventChunk.add(borrowedEvent);
noOfEvents++;
}
incrementalExecutor.execute(streamEventChunk);
if (throughputTrackerInsert != null && siddhiAppContext.isStatsEnabled()) {
throughputTrackerInsert.eventsIn(noOfEvents);
}
} finally {
if (latencyTrackerInsert != null && siddhiAppContext.isStatsEnabled()) {
latencyTrackerInsert.markOut();
}
}
}
Aggregations