Package org.apache.druid.query.scan
Class ScanQueryRunnerFactory
- java.lang.Object
-
- org.apache.druid.query.scan.ScanQueryRunnerFactory
-
- All Implemented Interfaces:
QueryRunnerFactory<ScanResultValue,ScanQuery>
public class ScanQueryRunnerFactory extends Object implements QueryRunnerFactory<ScanResultValue,ScanQuery>
-
-
Constructor Summary
Constructors Constructor Description ScanQueryRunnerFactory(ScanQueryQueryToolChest toolChest, ScanQueryEngine engine, ScanQueryConfig scanQueryConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryRunner<ScanResultValue>createRunner(Segment segment)Given a specific segment, this method will create aQueryRunner.QueryToolChest<ScanResultValue,ScanQuery>getToolchest()Provides access to theQueryToolChestfor this specificQuerytype.QueryRunner<ScanResultValue>mergeRunners(QueryProcessingPool queryProcessingPool, Iterable<QueryRunner<ScanResultValue>> queryRunners)Runners generated with createRunner() and combined into an Iterable in (time,shardId) order are passed along to this method with anQueryProcessingPool.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.QueryRunnerFactory
mergeRunners
-
-
-
-
Constructor Detail
-
ScanQueryRunnerFactory
@Inject public ScanQueryRunnerFactory(ScanQueryQueryToolChest toolChest, ScanQueryEngine engine, ScanQueryConfig scanQueryConfig)
-
-
Method Detail
-
createRunner
public QueryRunner<ScanResultValue> createRunner(Segment segment)
Description copied from interface:QueryRunnerFactoryGiven a specific segment, this method will create aQueryRunner. TheQueryRunner, when asked, will generate aSequenceof results based on the given segment. This is the meat of theQueryprocessing and is where the results are actually generated. Everything else is just merging and reduction logic.- Specified by:
createRunnerin interfaceQueryRunnerFactory<ScanResultValue,ScanQuery>- Parameters:
segment- The segment to process- Returns:
- A
QueryRunnerthat, when asked, will generate aSequenceof results based on the given segment
-
mergeRunners
public QueryRunner<ScanResultValue> mergeRunners(QueryProcessingPool queryProcessingPool, Iterable<QueryRunner<ScanResultValue>> queryRunners)
Description copied from interface:QueryRunnerFactoryRunners generated with createRunner() and combined into an Iterable in (time,shardId) order are passed along to this method with anQueryProcessingPool. The method should then return aQueryRunnerthat, when asked, will use theQueryProcessingPoolto run the base QueryRunners in some fashion. The vast majority of the time, this should be implemented withChainedExecutionQueryRunner: return new ChainedExecutionQueryRunner<>(queryProcessingPool, toolChest.getOrdering(), queryWatcher, queryRunners); Which will allow for parallel execution up to the maximum number of processing threads allowed. UnlikeQueryRunnerFactory.mergeRunners(ExecutorService, Iterable), this method takes aQueryProcessingPoolinstead which allows custom implementations for prioritize query execution on segments.- Specified by:
mergeRunnersin interfaceQueryRunnerFactory<ScanResultValue,ScanQuery>- Parameters:
queryProcessingPool-QueryProcessingPoolto be used for parallel processingqueryRunners- IndividualQueryRunnerobjects that produce some results- Returns:
- a
QueryRunnerthat, when asked, will use theExecutorServiceto run the baseQueryRunnercollection.
-
getToolchest
public QueryToolChest<ScanResultValue,ScanQuery> getToolchest()
Description copied from interface:QueryRunnerFactoryProvides access to theQueryToolChestfor this specificQuerytype.- Specified by:
getToolchestin interfaceQueryRunnerFactory<ScanResultValue,ScanQuery>- Returns:
- an instance of the toolchest for this specific query type.
-
-