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 boolean
awaitTermination(long l, TimeUnit timeUnit)
static PrioritizedExecutorService
create(Lifecycle lifecycle, DruidProcessingConfig config)
void
execute(Runnable runnable)
int
getActiveTasks()
Returns the approximate number of tasks being run by the thread pool currently.int
getQueueSize()
boolean
isShutdown()
boolean
isTerminated()
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)
void
shutdown()
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:
newTaskFor
in classAbstractExecutorService
-
newTaskFor
protected <T> org.apache.druid.query.PrioritizedListenableFutureTask<T> newTaskFor(Callable<T> callable)
- Overrides:
newTaskFor
in classAbstractExecutorService
-
submit
public com.google.common.util.concurrent.ListenableFuture<?> submit(Runnable task)
- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfacecom.google.common.util.concurrent.ListeningExecutorService
- Overrides:
submit
in classAbstractExecutorService
-
submit
public <T> com.google.common.util.concurrent.ListenableFuture<T> submit(Runnable task, @Nullable T result)
- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfacecom.google.common.util.concurrent.ListeningExecutorService
- Overrides:
submit
in classAbstractExecutorService
-
submit
public <T> com.google.common.util.concurrent.ListenableFuture<T> submit(Callable<T> task)
- Specified by:
submit
in interfaceExecutorService
- Specified by:
submit
in interfacecom.google.common.util.concurrent.ListeningExecutorService
- Overrides:
submit
in classAbstractExecutorService
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceExecutorService
-
shutdownNow
public List<Runnable> shutdownNow()
- Specified by:
shutdownNow
in interfaceExecutorService
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfaceExecutorService
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfaceExecutorService
-
awaitTermination
public boolean awaitTermination(long l, TimeUnit timeUnit) throws InterruptedException
- Specified by:
awaitTermination
in interfaceExecutorService
- Throws:
InterruptedException
-
getQueueSize
public int getQueueSize()
-
getActiveTasks
public int getActiveTasks()
Returns the approximate number of tasks being run by the thread pool currently.
-
-