Search in sources :

Example 26 with BigArrays

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);
}
Also used : BigArrays(org.elasticsearch.common.util.BigArrays) PipelineAggregator(org.elasticsearch.search.aggregations.pipeline.PipelineAggregator)

Aggregations

BigArrays (org.elasticsearch.common.util.BigArrays)26 LeafBucketCollectorBase (org.elasticsearch.search.aggregations.LeafBucketCollectorBase)12 ThreadPool (org.elasticsearch.threadpool.ThreadPool)10 SortedNumericDoubleValues (org.elasticsearch.index.fielddata.SortedNumericDoubleValues)8 NamedWriteableRegistry (org.elasticsearch.common.io.stream.NamedWriteableRegistry)7 Settings (org.elasticsearch.common.settings.Settings)7 CircuitBreakerService (org.elasticsearch.indices.breaker.CircuitBreakerService)6 TestThreadPool (org.elasticsearch.threadpool.TestThreadPool)6 NamedXContentRegistry (org.elasticsearch.common.xcontent.NamedXContentRegistry)5 NetworkPlugin (org.elasticsearch.plugins.NetworkPlugin)5 HashMap (java.util.HashMap)4 Map (java.util.Map)4 HttpServerTransport (org.elasticsearch.http.HttpServerTransport)4 Transport (org.elasticsearch.transport.Transport)4 List (java.util.List)3 NetworkService (org.elasticsearch.common.network.NetworkService)3 MockBigArrays (org.elasticsearch.common.util.MockBigArrays)3 NumericDoubleValues (org.elasticsearch.index.fielddata.NumericDoubleValues)3 Closeable (java.io.Closeable)2 IOException (java.io.IOException)2