use of org.elasticsearch.common.util.BigArrays in project elasticsearch by elastic.
the class AggregatorFactory method asMultiBucketAggregator.
/**
* Utility method. Given an {@link AggregatorFactory} that creates
* {@link Aggregator}s that only know how to collect bucket <tt>0</tt>, this
* returns an aggregator that can collect any bucket.
*/
protected static Aggregator asMultiBucketAggregator(final AggregatorFactory<?> factory, final SearchContext context, final Aggregator parent) throws IOException {
final Aggregator first = factory.create(parent, true);
final BigArrays bigArrays = context.bigArrays();
return new MultiBucketAggregatorWrapper(bigArrays, context, parent, factory, first);
}
Aggregations