Search in sources :

Example 11 with GroupedComplexEvent

use of org.wso2.siddhi.core.event.GroupedComplexEvent in project siddhi by wso2.

the class AggregationGroupByWindowedPerSnapshotOutputRateLimiter method constructOutputChunk.

private void constructOutputChunk(List<ComplexEventChunk<ComplexEvent>> outputEventChunks) {
    ComplexEventChunk<ComplexEvent> outputEventChunk = new ComplexEventChunk<ComplexEvent>(false);
    for (GroupedComplexEvent originalComplexEvent : eventList) {
        String currentGroupByKey = originalComplexEvent.getGroupKey();
        Map<Integer, Object> currentAggregateAttributeValueMap = groupByAggregateAttributeValueMap.get(currentGroupByKey);
        ComplexEvent eventCopy = cloneComplexEvent(originalComplexEvent.getComplexEvent());
        for (Integer position : aggregateAttributePositionList) {
            eventCopy.getOutputData()[position] = currentAggregateAttributeValueMap.get(position);
        }
        outputEventChunk.add(eventCopy);
    }
    outputEventChunks.add(outputEventChunk);
}
Also used : GroupedComplexEvent(org.wso2.siddhi.core.event.GroupedComplexEvent) ComplexEvent(org.wso2.siddhi.core.event.ComplexEvent) ComplexEventChunk(org.wso2.siddhi.core.event.ComplexEventChunk) GroupedComplexEvent(org.wso2.siddhi.core.event.GroupedComplexEvent)

Aggregations

ComplexEvent (org.wso2.siddhi.core.event.ComplexEvent)11 GroupedComplexEvent (org.wso2.siddhi.core.event.GroupedComplexEvent)11 ComplexEventChunk (org.wso2.siddhi.core.event.ComplexEventChunk)10 ArrayList (java.util.ArrayList)8 AttributeProcessor (org.wso2.siddhi.core.query.selector.attribute.processor.AttributeProcessor)2 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1