public class GroupByQueryRunnerFactory extends Object implements QueryRunnerFactory<ResultRow,GroupByQuery>
| Constructor and Description |
|---|
GroupByQueryRunnerFactory(GroupByStrategySelector strategySelector,
GroupByQueryQueryToolChest toolChest) |
| Modifier and Type | Method and Description |
|---|---|
QueryRunner<ResultRow> |
createRunner(Segment segment)
Given a specific segment, this method will create a
QueryRunner. |
GroupByStrategySelector |
getStrategySelector() |
QueryToolChest<ResultRow,GroupByQuery> |
getToolchest()
Provides access to the
QueryToolChest for this specific Query type. |
QueryRunner<ResultRow> |
mergeRunners(ExecutorService exec,
Iterable<QueryRunner<ResultRow>> queryRunners)
Runners generated with createRunner() and combined into an Iterable in (time,shardId) order are passed
along to this method with an
ExecutorService. |
@Inject public GroupByQueryRunnerFactory(GroupByStrategySelector strategySelector, GroupByQueryQueryToolChest toolChest)
public QueryRunner<ResultRow> createRunner(Segment segment)
QueryRunnerFactoryQueryRunner.
The QueryRunner, when asked, will generate a Sequence of
results based on the given segment. This is the meat of the Query processing and is where the results are
actually generated. Everything else is just merging and reduction logic.createRunner in interface QueryRunnerFactory<ResultRow,GroupByQuery>segment - The segment to processQueryRunner that, when asked, will generate a
Sequence of results based on the given segmentpublic QueryRunner<ResultRow> mergeRunners(ExecutorService exec, Iterable<QueryRunner<ResultRow>> queryRunners)
QueryRunnerFactoryExecutorService. The method should then return a QueryRunner that,
when asked, will use the ExecutorService to run the base QueryRunners in some fashion.
The vast majority of the time, this should be implemented with ChainedExecutionQueryRunner:
return new ChainedExecutionQueryRunner<>(queryExecutor, toolChest.getOrdering(), queryWatcher, queryRunners);
Which will allow for parallel execution up to the maximum number of processing threads allowed.mergeRunners in interface QueryRunnerFactory<ResultRow,GroupByQuery>exec - ExecutorService to be used for parallel processingqueryRunners - Individual QueryRunner objects that produce some resultsQueryRunner that, when asked, will use the ExecutorService to run the base
QueryRunner collection.public QueryToolChest<ResultRow,GroupByQuery> getToolchest()
QueryRunnerFactoryQueryToolChest for this specific Query type.getToolchest in interface QueryRunnerFactory<ResultRow,GroupByQuery>public GroupByStrategySelector getStrategySelector()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.