Package org.apache.druid.query
Class PrioritizedExecutorService
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- org.apache.druid.query.PrioritizedExecutorService
-
- All Implemented Interfaces:
com.google.common.util.concurrent.ListeningExecutorService,Executor,ExecutorService
public class PrioritizedExecutorService extends AbstractExecutorService implements com.google.common.util.concurrent.ListeningExecutorService
-
-
Constructor Summary
Constructors Constructor Description PrioritizedExecutorService(ThreadPoolExecutor threadPoolExecutor, boolean allowRegularTasks, int defaultPriority, DruidProcessingConfig config)PrioritizedExecutorService(ThreadPoolExecutor threadPoolExecutor, DruidProcessingConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long l, TimeUnit timeUnit)static PrioritizedExecutorServicecreate(Lifecycle lifecycle, DruidProcessingConfig config)voidexecute(Runnable runnable)intgetActiveTasks()Returns the approximate number of tasks being run by the thread pool currently.intgetQueueSize()booleanisShutdown()booleanisTerminated()protected <T> org.apache.druid.query.PrioritizedListenableFutureTask<T>newTaskFor(Runnable runnable, T value)protected <T> org.apache.druid.query.PrioritizedListenableFutureTask<T>newTaskFor(Callable<T> callable)voidshutdown()List<Runnable>shutdownNow()com.google.common.util.concurrent.ListenableFuture<?>submit(Runnable task)<T> com.google.common.util.concurrent.ListenableFuture<T>submit(Runnable task, T result)<T> com.google.common.util.concurrent.ListenableFuture<T>submit(Callable<T> task)-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ExecutorService
invokeAny, invokeAny
-
-
-
-
Constructor Detail
-
PrioritizedExecutorService
public PrioritizedExecutorService(ThreadPoolExecutor threadPoolExecutor, DruidProcessingConfig config)
-
PrioritizedExecutorService
public PrioritizedExecutorService(ThreadPoolExecutor threadPoolExecutor, boolean allowRegularTasks, int defaultPriority, DruidProcessingConfig config)
-
-
Method Detail
-
create
public static PrioritizedExecutorService create(Lifecycle lifecycle, DruidProcessingConfig config)
-
newTaskFor
protected <T> org.apache.druid.query.PrioritizedListenableFutureTask<T> newTaskFor(Runnable runnable, T value)
- Overrides:
newTaskForin classAbstractExecutorService
-
newTaskFor
protected <T> org.apache.druid.query.PrioritizedListenableFutureTask<T> newTaskFor(Callable<T> callable)
- Overrides:
newTaskForin classAbstractExecutorService
-
submit
public com.google.common.util.concurrent.ListenableFuture<?> submit(Runnable task)
- Specified by:
submitin interfaceExecutorService- Specified by:
submitin interfacecom.google.common.util.concurrent.ListeningExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
public <T> com.google.common.util.concurrent.ListenableFuture<T> submit(Runnable task, @Nullable T result)
- Specified by:
submitin interfaceExecutorService- Specified by:
submitin interfacecom.google.common.util.concurrent.ListeningExecutorService- Overrides:
submitin classAbstractExecutorService
-
submit
public <T> com.google.common.util.concurrent.ListenableFuture<T> submit(Callable<T> task)
- Specified by:
submitin interfaceExecutorService- Specified by:
submitin interfacecom.google.common.util.concurrent.ListeningExecutorService- Overrides:
submitin classAbstractExecutorService
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
public List<Runnable> shutdownNow()
- Specified by:
shutdownNowin interfaceExecutorService
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfaceExecutorService
-
awaitTermination
public boolean awaitTermination(long l, TimeUnit timeUnit) throws InterruptedException- Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException
-
getQueueSize
public int getQueueSize()
-
getActiveTasks
public int getActiveTasks()
Returns the approximate number of tasks being run by the thread pool currently.
-
-