public class RowBasedGrouperHelper extends Object
GroupByMergingQueryRunnerV2
and GroupByRowProcessor
.Modifier and Type | Class and Description |
---|---|
static class |
RowBasedGrouperHelper.RowBasedKey |
Modifier and Type | Method and Description |
---|---|
static Pair<Grouper<RowBasedGrouperHelper.RowBasedKey>,Accumulator<AggregateResult,ResultRow>> |
createGrouperAccumulatorPair(GroupByQuery query,
GroupByQuery subquery,
GroupByQueryConfig config,
com.google.common.base.Supplier<ByteBuffer> bufferSupplier,
LimitedTemporaryStorage temporaryStorage,
com.fasterxml.jackson.databind.ObjectMapper spillMapper,
int mergeBufferSize)
Create a single-threaded grouper and accumulator.
|
static Pair<Grouper<RowBasedGrouperHelper.RowBasedKey>,Accumulator<AggregateResult,ResultRow>> |
createGrouperAccumulatorPair(GroupByQuery query,
GroupByQuery subquery,
GroupByQueryConfig config,
com.google.common.base.Supplier<ByteBuffer> bufferSupplier,
ReferenceCountingResourceHolder<ByteBuffer> combineBufferHolder,
int concurrencyHint,
LimitedTemporaryStorage temporaryStorage,
com.fasterxml.jackson.databind.ObjectMapper spillMapper,
com.google.common.util.concurrent.ListeningExecutorService grouperSorter,
int priority,
boolean hasQueryTimeout,
long queryTimeoutAt,
int mergeBufferSize)
Create a
Grouper that groups according to the dimensions and aggregators in "query", along with
an Accumulator that accepts ResultRows and forwards them to the grouper. |
static ColumnSelectorFactory |
createResultRowBasedColumnSelectorFactory(GroupByQuery query,
com.google.common.base.Supplier<ResultRow> supplier)
Creates a
ColumnSelectorFactory that can read rows which originate as results of the provided "query". |
static CloseableGrouperIterator<RowBasedGrouperHelper.RowBasedKey,ResultRow> |
makeGrouperIterator(Grouper<RowBasedGrouperHelper.RowBasedKey> grouper,
GroupByQuery query,
Closeable closeable) |
static CloseableGrouperIterator<RowBasedGrouperHelper.RowBasedKey,ResultRow> |
makeGrouperIterator(Grouper<RowBasedGrouperHelper.RowBasedKey> grouper,
GroupByQuery query,
List<String> dimsToInclude,
Closeable closeable) |
public static Pair<Grouper<RowBasedGrouperHelper.RowBasedKey>,Accumulator<AggregateResult,ResultRow>> createGrouperAccumulatorPair(GroupByQuery query, @Nullable GroupByQuery subquery, GroupByQueryConfig config, com.google.common.base.Supplier<ByteBuffer> bufferSupplier, LimitedTemporaryStorage temporaryStorage, com.fasterxml.jackson.databind.ObjectMapper spillMapper, int mergeBufferSize)
public static Pair<Grouper<RowBasedGrouperHelper.RowBasedKey>,Accumulator<AggregateResult,ResultRow>> createGrouperAccumulatorPair(GroupByQuery query, @Nullable GroupByQuery subquery, GroupByQueryConfig config, com.google.common.base.Supplier<ByteBuffer> bufferSupplier, @Nullable ReferenceCountingResourceHolder<ByteBuffer> combineBufferHolder, int concurrencyHint, LimitedTemporaryStorage temporaryStorage, com.fasterxml.jackson.databind.ObjectMapper spillMapper, @Nullable com.google.common.util.concurrent.ListeningExecutorService grouperSorter, int priority, boolean hasQueryTimeout, long queryTimeoutAt, int mergeBufferSize)
Grouper
that groups according to the dimensions and aggregators in "query", along with
an Accumulator
that accepts ResultRows and forwards them to the grouper.
The pair will operate in one of two modes:
1) Combining mode (used if "subquery" is null). In this mode, filters from the "query" are ignored, and
its aggregators are converted into combining form. The input ResultRows are assumed to be partially-grouped
results originating from the provided "query".
2) Subquery mode (used if "subquery" is nonnull). In this mode, filters from the "query" (both intervals
and dim filters) are respected, and its aggregators are used in standard (not combining) form. The input
ResultRows are assumed to be results originating from the provided "subquery".query
- query that we are grouping forsubquery
- optional subquery that we are receiving results from (see combining vs. subquery
mode above)config
- groupBy query configbufferSupplier
- supplier of merge bufferscombineBufferHolder
- holder of combine buffers. Unused if concurrencyHint = -1, and may be null in that caseconcurrencyHint
- -1 for single-threaded Grouper, >=1 for concurrent GroupertemporaryStorage
- temporary storage used for spilling from the GrouperspillMapper
- object mapper used for spilling from the GroupergrouperSorter
- executor service used for parallel combining. Unused if concurrencyHint = -1, and may
be null in that casepriority
- query priorityhasQueryTimeout
- whether or not this query has a timeoutqueryTimeoutAt
- when this query times out, in milliseconds since the epochmergeBufferSize
- size of the merge buffers from "bufferSupplier"public static ColumnSelectorFactory createResultRowBasedColumnSelectorFactory(GroupByQuery query, com.google.common.base.Supplier<ResultRow> supplier)
ColumnSelectorFactory
that can read rows which originate as results of the provided "query".query
- a groupBy querysupplier
- supplier of result rows from the querypublic static CloseableGrouperIterator<RowBasedGrouperHelper.RowBasedKey,ResultRow> makeGrouperIterator(Grouper<RowBasedGrouperHelper.RowBasedKey> grouper, GroupByQuery query, Closeable closeable)
public static CloseableGrouperIterator<RowBasedGrouperHelper.RowBasedKey,ResultRow> makeGrouperIterator(Grouper<RowBasedGrouperHelper.RowBasedKey> grouper, GroupByQuery query, @Nullable List<String> dimsToInclude, Closeable closeable)
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.