org.elasticsearch.threadpool
Interface ThreadPool

All Superinterfaces:
java.util.concurrent.Executor
All Known Implementing Classes:
AbstractThreadPool, BlockingThreadPool, CachedThreadPool, ScalingThreadPool

public interface ThreadPool
extends java.util.concurrent.Executor


Method Summary
 boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
           
 java.util.concurrent.Executor cached()
          Returns a cached executor that will always allocate threads.
 void execute(java.lang.Runnable command)
           
 int getActiveCount()
          Returns the approximate number of threads that are actively executing tasks.
 int getMaxThreads()
          The maximum number of threads in the thread pool.
 int getMinThreads()
          The minimum number of threads in the thread pool.
 int getPoolSize()
          Returns the current number of threads in the pool.
 int getSchedulerActiveCount()
          The approximate number of threads that are actively executing scheduled tasks.
 int getSchedulerPoolSize()
          The size of the scheduler thread pool.
 int getSchedulerThreads()
          The size of scheduler threads.
 ThreadPoolInfo info()
           
 boolean isStarted()
          Returns true if the thread pool has started.
<V> java.util.concurrent.ScheduledFuture<V>
schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
           
 java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
           
 java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, TimeValue delay)
           
 java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
           
 java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
           
 java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, TimeValue interval)
           
 void shutdown()
          Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
 void shutdownNow()
           
 ThreadPoolStats stats()
           
 

Method Detail

info

ThreadPoolInfo info()

stats

ThreadPoolStats stats()

getMinThreads

int getMinThreads()
The minimum number of threads in the thread pool.


getMaxThreads

int getMaxThreads()
The maximum number of threads in the thread pool.


getSchedulerThreads

int getSchedulerThreads()
The size of scheduler threads.


getPoolSize

int getPoolSize()
Returns the current number of threads in the pool.

Returns:
the number of threads

getActiveCount

int getActiveCount()
Returns the approximate number of threads that are actively executing tasks.

Returns:
the number of threads

getSchedulerPoolSize

int getSchedulerPoolSize()
The size of the scheduler thread pool.


getSchedulerActiveCount

int getSchedulerActiveCount()
The approximate number of threads that are actively executing scheduled tasks.


isStarted

boolean isStarted()
Returns true if the thread pool has started.


cached

java.util.concurrent.Executor cached()
Returns a cached executor that will always allocate threads.


shutdownNow

void shutdownNow()

shutdown

void shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.


awaitTermination

boolean awaitTermination(long timeout,
                         java.util.concurrent.TimeUnit unit)
                         throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

execute

void execute(java.lang.Runnable command)
Specified by:
execute in interface java.util.concurrent.Executor

schedule

java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command,
                                                 long delay,
                                                 java.util.concurrent.TimeUnit unit)

schedule

<V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable,
                                                     long delay,
                                                     java.util.concurrent.TimeUnit unit)

scheduleAtFixedRate

java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command,
                                                            long initialDelay,
                                                            long period,
                                                            java.util.concurrent.TimeUnit unit)

scheduleWithFixedDelay

java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command,
                                                               long initialDelay,
                                                               long delay,
                                                               java.util.concurrent.TimeUnit unit)

schedule

java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command,
                                                 TimeValue delay)

scheduleWithFixedDelay

java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command,
                                                               TimeValue interval)