|
@@ -20,13 +20,21 @@ import java.util.Map;
|
|
|
*/
|
|
|
public final class AggregatorsReducer implements Releasable {
|
|
|
|
|
|
- private final Map<String, AggregatorReducer> aggByName = new HashMap<>();
|
|
|
+ private final Map<String, AggregatorReducer> aggByName;
|
|
|
private final AggregationReduceContext context;
|
|
|
private final int size;
|
|
|
|
|
|
- public AggregatorsReducer(AggregationReduceContext context, int size) {
|
|
|
+ /**
|
|
|
+ * Solo constructor
|
|
|
+ *
|
|
|
+ * @param proto The prototype {@link InternalAggregations} we are aggregating.
|
|
|
+ * @param context The aggregation context
|
|
|
+ * @param size The number of {@link InternalAggregations} we are aggregating.
|
|
|
+ */
|
|
|
+ public AggregatorsReducer(InternalAggregations proto, AggregationReduceContext context, int size) {
|
|
|
this.context = context;
|
|
|
this.size = size;
|
|
|
+ aggByName = new HashMap<>(proto.asList().size());
|
|
|
}
|
|
|
|
|
|
/**
|