Search in sources :

Example 1 with PersistedAggregationResultsProcessor

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;
}
Also used : PersistedAggregationResultsProcessor(io.siddhi.core.aggregation.persistedaggregation.config.PersistedAggregationResultsProcessor) AbstractStreamProcessor(io.siddhi.core.query.processor.stream.AbstractStreamProcessor) Attribute(io.siddhi.query.api.definition.Attribute) OutputAttribute(io.siddhi.query.api.execution.query.selection.OutputAttribute) ConfigReader(io.siddhi.core.util.config.ConfigReader) AbstractDefinition(io.siddhi.query.api.definition.AbstractDefinition)

Aggregations

PersistedAggregationResultsProcessor (io.siddhi.core.aggregation.persistedaggregation.config.PersistedAggregationResultsProcessor)1 AbstractStreamProcessor (io.siddhi.core.query.processor.stream.AbstractStreamProcessor)1 ConfigReader (io.siddhi.core.util.config.ConfigReader)1 AbstractDefinition (io.siddhi.query.api.definition.AbstractDefinition)1 Attribute (io.siddhi.query.api.definition.Attribute)1 OutputAttribute (io.siddhi.query.api.execution.query.selection.OutputAttribute)1