List<AggregationAccessorSlotPair> accessorPairs = new ArrayList<AggregationAccessorSlotPair>();
List<AggregationStateFactory> stateFactories = new ArrayList<AggregationStateFactory>();
for (AggregationServiceAggExpressionDesc aggregation : aggregations)
{
ExprAggregateNode aggregateNode = aggregation.getAggregationNode();
if (!aggregateNode.getFactory().isAccessAggregation()) {
continue;
}
AggregationStateKey providerKey = aggregateNode.getFactory().getAggregationStateKey(false);
AggregationAccessor accessor = aggregateNode.getFactory().getAccessor();
Integer slot = accessProviderSlots.get(providerKey);
if (slot == null) {
accessProviderSlots.put(providerKey, currentSlot);
slot = currentSlot++;
AggregationStateFactory providerFactory = aggregateNode.getFactory().getAggregationStateFactory(false);
stateFactories.add(providerFactory);
}
accessorPairs.add(new AggregationAccessorSlotPair(slot, accessor));
}