Package org.apache.druid.query
Interface QueryProcessingPool
- All Superinterfaces:
Executor,ExecutorService,com.google.common.util.concurrent.ListeningExecutorService
- All Known Implementing Classes:
DirectQueryProcessingPool,ForwardingQueryProcessingPool,MetricsEmittingQueryProcessingPool,NoopQueryProcessingPool
public interface QueryProcessingPool
extends com.google.common.util.concurrent.ListeningExecutorService
This class implements the logic of how units of query execution run concurrently. It is used in
QueryRunnerFactory.mergeRunners(QueryProcessingPool, Iterable).
In a most straightforward implementation, each unit will be submitted to an PrioritizedExecutorService. Extensions,
however, can implement their own logic for picking which unit to pick first for execution.
This interface extends ListeningExecutorService as well. It has a separate
method to submit query execution tasks so that implementations can differentiate those tasks from any regular async
tasks. One example is GroupingEngine.mergeRunners(QueryProcessingPool, Iterable)
where different kind of tasks are submitted to same processing pool.
Query execution task also includes a reference to QueryRunner so that any state required to decide the priority
of a unit can be carried forward with the corresponding QueryRunner.
-
Method Summary
Modifier and TypeMethodDescription<T,V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T, V> task) Submits the query execution unit task for asynchronous execution.<T,V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T, V> task, long timeout, TimeUnit unit) Submits the query execution task for asynchronous execution, with a provided timeout.Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNowMethods inherited from interface com.google.common.util.concurrent.ListeningExecutorService
awaitTermination, invokeAll, invokeAll, invokeAll, invokeAny, submit, submit, submit
-
Method Details
-
submitRunnerTask
<T,V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T, V> task) Submits the query execution unit task for asynchronous execution.- Type Parameters:
T- - Task result typeV- - Query runner sequence type- Parameters:
task- - Task to be submitted.- Returns:
- - Future object for tracking the task completion.
-
submitRunnerTask
<T,V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T, V> task, long timeout, TimeUnit unit) Submits the query execution task for asynchronous execution, with a provided timeout.- Type Parameters:
T- - Task result typeV- - Query runner sequence type- Parameters:
task- - Task to be submitted.timeout- - Timeout valueunit- - Timeout unit- Returns:
- - Future object for tracking the task completion.
-