public interface QueryRunnerFactory<T,QueryType extends Query<T>>
Modifier and Type | Method and Description |
---|---|
QueryRunner<T> |
createRunner(Segment segment)
Given a specific segment, this method will create a
QueryRunner . |
QueryToolChest<T,QueryType> |
getToolchest()
Provides access to the
QueryToolChest for this specific Query type. |
QueryRunner<T> |
mergeRunners(ExecutorService queryExecutor,
Iterable<QueryRunner<T>> queryRunners)
Runners generated with createRunner() and combined into an Iterable in (time,shardId) order are passed
along to this method with an
ExecutorService . |
QueryRunner<T> createRunner(Segment segment)
QueryRunner
.
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.segment
- The segment to processQueryRunner
that, when asked, will generate a
Sequence
of results based on the given segmentQueryRunner<T> mergeRunners(ExecutorService queryExecutor, Iterable<QueryRunner<T>> queryRunners)
ExecutorService
. 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.queryExecutor
- 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.QueryToolChest<T,QueryType> getToolchest()
QueryToolChest
for this specific Query
type.Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.