org.elasticsearch.util.concurrent
Class ScalingThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by 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)
           
 
Method Summary
 boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
           
 void execute(java.lang.Runnable command)
           
 int getActiveCount()
          Returns the approximate number of threads that are actively executing tasks.
 int getPoolSize()
          Returns the current number of threads in the pool.
 boolean isShutdown()
           
 boolean isTerminated()
           
 void shutdown()
           
 java.util.List<java.lang.Runnable> shutdownNow()
           
 
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
 

Constructor Detail

ScalingThreadPoolExecutor

public ScalingThreadPoolExecutor(int corePoolSize,
                                 int maximumPoolSize,
                                 TimeValue keepAlive,
                                 java.util.concurrent.ThreadFactory threadFactory,
                                 java.util.concurrent.ScheduledExecutorService scheduler,
                                 TimeValue schedulerInterval)
Method Detail

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