Package org.apache.druid.query
Class ForwardingQueryProcessingPool
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.util.concurrent.ForwardingExecutorService
com.google.common.util.concurrent.ForwardingListeningExecutorService
org.apache.druid.query.ForwardingQueryProcessingPool
- All Implemented Interfaces:
com.google.common.util.concurrent.ListeningExecutorService,Executor,ExecutorService,QueryProcessingPool
- Direct Known Subclasses:
MetricsEmittingQueryProcessingPool
public class ForwardingQueryProcessingPool
extends com.google.common.util.concurrent.ForwardingListeningExecutorService
implements QueryProcessingPool
Default implementation of
QueryProcessingPool that just forwards operations, including query execution tasks,
to an underlying ExecutorService
Exposes a method submitRunnerTask(PrioritizedQueryRunnerCallable, long, TimeUnit) which allows execution tasks to be serviced a custom timeout.-
Constructor Summary
ConstructorsConstructorDescriptionForwardingQueryProcessingPool(ExecutorService executorService) ForwardingQueryProcessingPool(ExecutorService executorService, ScheduledExecutorService timeoutService) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.common.util.concurrent.ListeningExecutorServicedelegate()voidshutdown()<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 class com.google.common.util.concurrent.ForwardingListeningExecutorService
submit, submit, submitMethods inherited from class com.google.common.util.concurrent.ForwardingExecutorService
awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdownNowMethods inherited from class com.google.common.collect.ForwardingObject
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAny, invokeAny, isShutdown, isTerminated, shutdownNowMethods inherited from interface com.google.common.util.concurrent.ListeningExecutorService
awaitTermination, invokeAll, invokeAll, invokeAll, invokeAny, submit, submit, submit
-
Constructor Details
-
ForwardingQueryProcessingPool
public ForwardingQueryProcessingPool(ExecutorService executorService, @Nullable ScheduledExecutorService timeoutService) -
ForwardingQueryProcessingPool
-
-
Method Details
-
submitRunnerTask
public <T,V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T, V> task) Description copied from interface:QueryProcessingPoolSubmits the query execution unit task for asynchronous execution.- Specified by:
submitRunnerTaskin interfaceQueryProcessingPool- 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
public <T,V> com.google.common.util.concurrent.ListenableFuture<T> submitRunnerTask(PrioritizedQueryRunnerCallable<T, V> task, long timeout, TimeUnit unit) Description copied from interface:QueryProcessingPoolSubmits the query execution task for asynchronous execution, with a provided timeout.- Specified by:
submitRunnerTaskin interfaceQueryProcessingPool- 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.
-
delegate
protected com.google.common.util.concurrent.ListeningExecutorService delegate()- Specified by:
delegatein classcom.google.common.util.concurrent.ForwardingListeningExecutorService
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceExecutorService- Overrides:
shutdownin classcom.google.common.util.concurrent.ForwardingExecutorService
-