use of org.wso2.siddhi.core.executor.incremental.IncrementalUnixTimeFunctionExecutor in project siddhi by wso2.
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