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. |
default QueryRunner<T> |
mergeRunners(ExecutorService queryExecutor,
Iterable<QueryRunner<T>> queryRunners)
Deprecated.
Use
mergeRunners(QueryProcessingPool, Iterable) instead.
Runners generated with createRunner() and combined into an Iterable in (time,shardId) order are passed
along to this method with an 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. |
QueryRunner<T> |
mergeRunners(QueryProcessingPool queryProcessingPool,
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
QueryProcessingPool. |
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 segment@Deprecated default QueryRunner<T> mergeRunners(ExecutorService queryExecutor, Iterable<QueryRunner<T>> queryRunners)
mergeRunners(QueryProcessingPool, Iterable) instead.
Runners generated with createRunner() and combined into an Iterable in (time,shardId) order are passed
along to this method with an 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.QueryRunner<T> mergeRunners(QueryProcessingPool queryProcessingPool, Iterable<QueryRunner<T>> queryRunners)
QueryProcessingPool. The method should then return a QueryRunner that,
when asked, will use the QueryProcessingPool to run the base QueryRunners in some fashion.
The vast majority of the time, this should be implemented with ChainedExecutionQueryRunner:
return new ChainedExecutionQueryRunner<>(queryProcessingPool, toolChest.getOrdering(), queryWatcher, queryRunners);
Which will allow for parallel execution up to the maximum number of processing threads allowed.
Unlike mergeRunners(ExecutorService, Iterable), this method takes a QueryProcessingPool instead
which allows custom implementations for prioritize query execution on segments.queryProcessingPool - QueryProcessingPool 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–2023 The Apache Software Foundation. All rights reserved.