use of io.siddhi.core.aggregation.persistedaggregation.config.PersistedAggregationResultsProcessor in project siddhi by wso2.
the class AggregationParser method getCudProcessor.
private static Processor getCudProcessor(StreamHandler streamHandler, SiddhiQueryContext siddhiQueryContext, MetaStreamEvent metaStreamEvent, ExpressionExecutor[] attributeExpressionExecutors, TimePeriod.Duration duration) {
ConfigReader configReader = siddhiQueryContext.getSiddhiContext().getConfigManager().generateConfigReader(((StreamFunction) streamHandler).getNamespace(), ((StreamFunction) streamHandler).getName());
AbstractStreamProcessor abstractStreamProcessor;
abstractStreamProcessor = (StreamProcessor) SiddhiClassLoader.loadExtensionImplementation((Extension) streamHandler, StreamProcessorExtensionHolder.getInstance(siddhiQueryContext.getSiddhiAppContext()));
abstractStreamProcessor.initProcessor(metaStreamEvent, attributeExpressionExecutors, configReader, false, false, false, streamHandler, siddhiQueryContext);
if (metaStreamEvent.getInputDefinitions().size() == 2) {
AbstractDefinition outputDefinition = metaStreamEvent.getInputDefinitions().get(1);
List<Attribute> outputAttributes = outputDefinition.getAttributeList();
for (Attribute attribute : outputAttributes) {
metaStreamEvent.addOutputData(attribute);
}
metaStreamEvent.setOutputDefinition((StreamDefinition) outputDefinition);
}
abstractStreamProcessor.constructStreamEventPopulater(metaStreamEvent, 0);
abstractStreamProcessor.setNextProcessor(new PersistedAggregationResultsProcessor(duration));
return abstractStreamProcessor;
}
Aggregations