org.elasticsearch.util.concurrent
Class ScalingThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
org.elasticsearch.util.concurrent.ScalingThreadPoolExecutor
- All Implemented Interfaces:
- java.util.concurrent.Executor, java.util.concurrent.ExecutorService
public class ScalingThreadPoolExecutor
- extends java.util.concurrent.AbstractExecutorService
Constructor Summary |
ScalingThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
TimeValue keepAlive,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.ScheduledExecutorService scheduler,
TimeValue schedulerInterval)
|
Methods inherited from class java.util.concurrent.AbstractExecutorService |
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScalingThreadPoolExecutor
public ScalingThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
TimeValue keepAlive,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.ScheduledExecutorService scheduler,
TimeValue schedulerInterval)
execute
public void execute(java.lang.Runnable command)
shutdown
public void shutdown()
shutdownNow
public java.util.List<java.lang.Runnable> shutdownNow()
isShutdown
public boolean isShutdown()
isTerminated
public boolean isTerminated()
awaitTermination
public boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
getPoolSize
public int getPoolSize()
- Returns the current number of threads in the pool.
- Returns:
- the number of threads
getActiveCount
public int getActiveCount()
- Returns the approximate number of threads that are actively
executing tasks.
- Returns:
- the number of threads