java.lang.Object
org.elasticsearch.threadpool.ExecutorBuilder<org.elasticsearch.threadpool.ScalingExecutorBuilder.ScalingExecutorSettings>
org.elasticsearch.threadpool.ScalingExecutorBuilder
public final class ScalingExecutorBuilder
extends ExecutorBuilder<org.elasticsearch.threadpool.ScalingExecutorBuilder.ScalingExecutorSettings>
A builder for scaling executors.
The
build(org.elasticsearch.threadpool.ScalingExecutorBuilder.ScalingExecutorSettings, org.elasticsearch.common.util.concurrent.ThreadContext) method will instantiate a java ExecutorService thread pool that starts with the specified minimum number of
threads and then scales up to the specified max number of threads as needed for excess work, scaling back when the burst of activity
stops. As opposed to the FixedExecutorBuilder that keeps a fixed number of threads alive.-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown) Construct a scaling executor builder; the settings will have the key prefix "thread_pool." followed by the executor name.ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown, String prefix) Construct a scaling executor builder; the settings will have the specified key prefix.ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown, String prefix, EsExecutors.TaskTrackingConfig trackingConfig, EsExecutors.HotThreadsOnLargeQueueConfig hotThreadsOnLargeQueueConfig) Construct a scaling executor builder; the settings will have the specified key prefix.ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown, EsExecutors.HotThreadsOnLargeQueueConfig hotThreadsOnLargeQueueConfig) Construct a scaling executor builder; the settings will have the key prefix "thread_pool." followed by the executor name. -
Method Summary
Modifier and TypeMethodDescriptionThe list of settings this builder will register.Methods inherited from class org.elasticsearch.threadpool.ExecutorBuilder
applyHardSizeLimit, isSystemThread, name, settingsKey
-
Field Details
-
HOT_THREADS_ON_LARGE_QUEUE_SIZE_THRESHOLD_SETTING
-
HOT_THREADS_ON_LARGE_QUEUE_DURATION_THRESHOLD_SETTING
-
HOT_THREADS_ON_LARGE_QUEUE_INTERVAL_SETTING
-
-
Constructor Details
-
ScalingExecutorBuilder
public ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown) Construct a scaling executor builder; the settings will have the key prefix "thread_pool." followed by the executor name.- Parameters:
name- the name of the executorcore- the minimum number of threads in the poolmax- the maximum number of threads in the poolkeepAlive- the time that spare threads abovecorethreads will be kept aliverejectAfterShutdown- set totrueif the executor should reject tasks after shutdown
-
ScalingExecutorBuilder
public ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown, EsExecutors.HotThreadsOnLargeQueueConfig hotThreadsOnLargeQueueConfig) Construct a scaling executor builder; the settings will have the key prefix "thread_pool." followed by the executor name.- Parameters:
name- the name of the executorcore- the minimum number of threads in the poolmax- the maximum number of threads in the poolkeepAlive- the time that spare threads abovecorethreads will be kept aliverejectAfterShutdown- set totrueif the executor should reject tasks after shutdownhotThreadsOnLargeQueueConfig- configuration for indicating whether hot threads should be logged on large queue size
-
ScalingExecutorBuilder
public ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown, String prefix) Construct a scaling executor builder; the settings will have the specified key prefix.- Parameters:
name- the name of the executorcore- the minimum number of threads in the poolmax- the maximum number of threads in the poolkeepAlive- the time that spare threads abovecorethreads will be kept aliverejectAfterShutdown- set totrueif the executor should reject tasks after shutdownprefix- the prefix for the settings keys
-
ScalingExecutorBuilder
public ScalingExecutorBuilder(String name, int core, int max, TimeValue keepAlive, boolean rejectAfterShutdown, String prefix, EsExecutors.TaskTrackingConfig trackingConfig, EsExecutors.HotThreadsOnLargeQueueConfig hotThreadsOnLargeQueueConfig) Construct a scaling executor builder; the settings will have the specified key prefix.- Parameters:
name- the name of the executorcore- the minimum number of threads in the poolmax- the maximum number of threads in the poolkeepAlive- the time that spare threads abovecorethreads will be kept aliverejectAfterShutdown- set totrueif the executor should reject tasks after shutdownprefix- the prefix for the settings keystrackingConfig- configuration that'll indicate if we should track statistics about task execution timehotThreadsOnLargeQueueConfig- configuration for indicating whether hot threads should be logged on large queue size
-
-
Method Details
-
getRegisteredSettings
Description copied from class:ExecutorBuilderThe list of settings this builder will register.- Specified by:
getRegisteredSettingsin classExecutorBuilder<org.elasticsearch.threadpool.ScalingExecutorBuilder.ScalingExecutorSettings>- Returns:
- the list of registered settings
-