Class TimeBoundaryQueryRunnerFactory
- java.lang.Object
-
- org.apache.druid.query.timeboundary.TimeBoundaryQueryRunnerFactory
-
- All Implemented Interfaces:
QueryRunnerFactory<Result<TimeBoundaryResultValue>,TimeBoundaryQuery>
public class TimeBoundaryQueryRunnerFactory extends Object implements QueryRunnerFactory<Result<TimeBoundaryResultValue>,TimeBoundaryQuery>
-
-
Constructor Summary
Constructors Constructor Description TimeBoundaryQueryRunnerFactory(QueryWatcher queryWatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryRunner<Result<TimeBoundaryResultValue>>
createRunner(Segment segment)
Given a specific segment, this method will create aQueryRunner
.QueryToolChest<Result<TimeBoundaryResultValue>,TimeBoundaryQuery>
getToolchest()
Provides access to theQueryToolChest
for this specificQuery
type.QueryRunner<Result<TimeBoundaryResultValue>>
mergeRunners(QueryProcessingPool queryProcessingPool, Iterable<QueryRunner<Result<TimeBoundaryResultValue>>> 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
-
TimeBoundaryQueryRunnerFactory
@Inject public TimeBoundaryQueryRunnerFactory(QueryWatcher queryWatcher)
-
-
Method Detail
-
createRunner
public QueryRunner<Result<TimeBoundaryResultValue>> createRunner(Segment segment)
Description copied from interface:QueryRunnerFactory
Given a specific segment, this method will create aQueryRunner
. TheQueryRunner
, when asked, will generate aSequence
of results based on the given segment. This is the meat of theQuery
processing and is where the results are actually generated. Everything else is just merging and reduction logic.- Specified by:
createRunner
in interfaceQueryRunnerFactory<Result<TimeBoundaryResultValue>,TimeBoundaryQuery>
- Parameters:
segment
- The segment to process- Returns:
- A
QueryRunner
that, when asked, will generate aSequence
of results based on the given segment
-
mergeRunners
public QueryRunner<Result<TimeBoundaryResultValue>> mergeRunners(QueryProcessingPool queryProcessingPool, Iterable<QueryRunner<Result<TimeBoundaryResultValue>>> queryRunners)
Description copied from interface:QueryRunnerFactory
Runners 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 aQueryRunner
that, when asked, will use theQueryProcessingPool
to 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 aQueryProcessingPool
instead which allows custom implementations for prioritize query execution on segments.- Specified by:
mergeRunners
in interfaceQueryRunnerFactory<Result<TimeBoundaryResultValue>,TimeBoundaryQuery>
- Parameters:
queryProcessingPool
-QueryProcessingPool
to be used for parallel processingqueryRunners
- IndividualQueryRunner
objects that produce some results- Returns:
- a
QueryRunner
that, when asked, will use theExecutorService
to run the baseQueryRunner
collection.
-
getToolchest
public QueryToolChest<Result<TimeBoundaryResultValue>,TimeBoundaryQuery> getToolchest()
Description copied from interface:QueryRunnerFactory
Provides access to theQueryToolChest
for this specificQuery
type.- Specified by:
getToolchest
in interfaceQueryRunnerFactory<Result<TimeBoundaryResultValue>,TimeBoundaryQuery>
- Returns:
- an instance of the toolchest for this specific query type.
-
-