|
@@ -51,28 +51,7 @@ public final class FixedExecutorBuilder extends ExecutorBuilder<FixedExecutorBui
|
|
|
* @param trackEWMA whether to track the exponentially weighted moving average of the task execution time
|
|
|
*/
|
|
|
FixedExecutorBuilder(final Settings settings, final String name, final int size, final int queueSize, final boolean trackEWMA) {
|
|
|
- this(settings, name, size, queueSize, trackEWMA, false);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Construct a fixed executor builder; the settings will have the key prefix "thread_pool." followed by the executor name.
|
|
|
- *
|
|
|
- * @param settings the node-level settings
|
|
|
- * @param name the name of the executor
|
|
|
- * @param size the fixed number of threads
|
|
|
- * @param queueSize the size of the backing queue, -1 for unbounded
|
|
|
- * @param trackEWMA whether to track the exponentially weighted moving average of the task execution time
|
|
|
- * @param deprecated whether or not the thread pool is deprecated
|
|
|
- */
|
|
|
- FixedExecutorBuilder(
|
|
|
- final Settings settings,
|
|
|
- final String name,
|
|
|
- final int size,
|
|
|
- final int queueSize,
|
|
|
- final boolean trackEWMA,
|
|
|
- final boolean deprecated
|
|
|
- ) {
|
|
|
- this(settings, name, size, queueSize, "thread_pool." + name, trackEWMA, deprecated);
|
|
|
+ this(settings, name, size, queueSize, "thread_pool." + name, trackEWMA);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -87,45 +66,16 @@ public final class FixedExecutorBuilder extends ExecutorBuilder<FixedExecutorBui
|
|
|
*/
|
|
|
public FixedExecutorBuilder(final Settings settings, final String name, final int size, final int queueSize, final String prefix,
|
|
|
final boolean trackEWMA) {
|
|
|
- this(settings, name, size, queueSize, prefix, trackEWMA, false);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Construct a fixed executor builder.
|
|
|
- *
|
|
|
- * @param settings the node-level settings
|
|
|
- * @param name the name of the executor
|
|
|
- * @param size the fixed number of threads
|
|
|
- * @param queueSize the size of the backing queue, -1 for unbounded
|
|
|
- * @param prefix the prefix for the settings keys
|
|
|
- * @param trackEWMA whether to track the exponentially weighted moving average of the task execution time
|
|
|
- * @param deprecated whether or not the thread pool is deprecated
|
|
|
- */
|
|
|
- public FixedExecutorBuilder(
|
|
|
- final Settings settings,
|
|
|
- final String name,
|
|
|
- final int size,
|
|
|
- final int queueSize,
|
|
|
- final String prefix,
|
|
|
- final boolean trackEWMA,
|
|
|
- final boolean deprecated
|
|
|
- ) {
|
|
|
super(name);
|
|
|
final String sizeKey = settingsKey(prefix, "size");
|
|
|
- final Setting.Property[] properties;
|
|
|
- if (deprecated) {
|
|
|
- properties = new Setting.Property[]{Setting.Property.NodeScope, Setting.Property.Deprecated};
|
|
|
- } else {
|
|
|
- properties = new Setting.Property[]{Setting.Property.NodeScope};
|
|
|
- }
|
|
|
this.sizeSetting =
|
|
|
- new Setting<>(
|
|
|
- sizeKey,
|
|
|
- s -> Integer.toString(size),
|
|
|
- s -> Setting.parseInt(s, 1, applyHardSizeLimit(settings, name), sizeKey),
|
|
|
- properties);
|
|
|
+ new Setting<>(
|
|
|
+ sizeKey,
|
|
|
+ s -> Integer.toString(size),
|
|
|
+ s -> Setting.parseInt(s, 1, applyHardSizeLimit(settings, name), sizeKey),
|
|
|
+ Setting.Property.NodeScope);
|
|
|
final String queueSizeKey = settingsKey(prefix, "queue_size");
|
|
|
- this.queueSizeSetting = Setting.intSetting(queueSizeKey, queueSize, properties);
|
|
|
+ this.queueSizeSetting = Setting.intSetting(queueSizeKey, queueSize, Setting.Property.NodeScope);
|
|
|
this.trackEWMA = trackEWMA;
|
|
|
}
|
|
|
|