public class TopNQueryEngine extends Object
| Constructor and Description |
|---|
TopNQueryEngine(NonBlockingPool<ByteBuffer> bufferPool) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canApplyExtractionInPost(TopNQuery query)
ExtractionFn which are one to one may have their execution deferred until as late as possible, since the
which value is used as the grouping key itself doesn't particularly matter. |
Sequence<Result<TopNResultValue>> |
query(TopNQuery query,
StorageAdapter adapter,
TopNQueryMetrics queryMetrics)
Do the thing - process a
StorageAdapter into a Sequence of TopNResultValue, with one of the
fine TopNAlgorithm available chosen based on the type of column being aggregated. |
public TopNQueryEngine(NonBlockingPool<ByteBuffer> bufferPool)
public Sequence<Result<TopNResultValue>> query(TopNQuery query, StorageAdapter adapter, @Nullable TopNQueryMetrics queryMetrics)
StorageAdapter into a Sequence of TopNResultValue, with one of the
fine TopNAlgorithm available chosen based on the type of column being aggregated. The algorithm provides a
mapping function to process rows from the adapter Cursor to apply
AggregatorFactory and create or update TopNResultValuepublic static boolean canApplyExtractionInPost(TopNQuery query)
ExtractionFn which are one to one may have their execution deferred until as late as possible, since the
which value is used as the grouping key itself doesn't particularly matter. For top-n, this method allows the
query to be transformed in TopNQueryQueryToolChest.preMergeQueryDecoration(org.apache.druid.query.QueryRunner<org.apache.druid.query.Result<org.apache.druid.query.topn.TopNResultValue>>) to strip off the
ExtractionFn on the broker, so that a more optimized algorithm (e.g. PooledTopNAlgorithm) can be
chosen for processing segments, and then added back and evaluated against the final merged result sets on the
broker via TopNQueryQueryToolChest.postMergeQueryDecoration(org.apache.druid.query.QueryRunner<org.apache.druid.query.Result<org.apache.druid.query.topn.TopNResultValue>>).Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.