@@ -41,16 +41,28 @@ public final class FixedExecutorBuilder extends ExecutorBuilder<FixedExecutorBui
4141 private final Setting <Integer > queueSizeSetting ;
4242
4343 /**
44- * Construct a fixed executor builder; the settings will have the
45- * key prefix "thread_pool." followed by the executor name.
44+ * Construct a fixed executor builder; the settings will have the key prefix "thread_pool." followed by the executor name.
4645 *
4746 * @param settings the node-level settings
4847 * @param name the name of the executor
4948 * @param size the fixed number of threads
5049 * @param queueSize the size of the backing queue, -1 for unbounded
5150 */
5251 FixedExecutorBuilder (final Settings settings , final String name , final int size , final int queueSize ) {
53- this (settings , name , size , queueSize , "thread_pool." + name );
52+ this (settings , name , size , queueSize , false );
53+ }
54+
55+ /**
56+ * Construct a fixed executor builder; the settings will have the key prefix "thread_pool." followed by the executor name.
57+ *
58+ * @param settings the node-level settings
59+ * @param name the name of the executor
60+ * @param size the fixed number of threads
61+ * @param queueSize the size of the backing queue, -1 for unbounded
62+ * @param deprecated whether or not the thread pool is deprecated
63+ */
64+ FixedExecutorBuilder (final Settings settings , final String name , final int size , final int queueSize , final boolean deprecated ) {
65+ this (settings , name , size , queueSize , "thread_pool." + name , deprecated );
5466 }
5567
5668 /**
@@ -63,17 +75,41 @@ public final class FixedExecutorBuilder extends ExecutorBuilder<FixedExecutorBui
6375 * @param prefix the prefix for the settings keys
6476 */
6577 public FixedExecutorBuilder (final Settings settings , final String name , final int size , final int queueSize , final String prefix ) {
78+ this (settings , name , size , queueSize , prefix , false );
79+ }
80+
81+ /**
82+ * Construct a fixed executor builder.
83+ *
84+ * @param settings the node-level settings
85+ * @param name the name of the executor
86+ * @param size the fixed number of threads
87+ * @param queueSize the size of the backing queue, -1 for unbounded
88+ * @param prefix the prefix for the settings keys
89+ */
90+ private FixedExecutorBuilder (
91+ final Settings settings ,
92+ final String name ,
93+ final int size ,
94+ final int queueSize ,
95+ final String prefix ,
96+ final boolean deprecated ) {
6697 super (name );
6798 final String sizeKey = settingsKey (prefix , "size" );
99+ final Setting .Property [] properties ;
100+ if (deprecated ) {
101+ properties = new Setting .Property []{Setting .Property .NodeScope , Setting .Property .Deprecated };
102+ } else {
103+ properties = new Setting .Property []{Setting .Property .NodeScope };
104+ }
68105 this .sizeSetting =
69- new Setting <>(
70- sizeKey ,
71- s -> Integer .toString (size ),
72- s -> Setting .parseInt (s , 1 , applyHardSizeLimit (settings , name ), sizeKey ),
73- Setting . Property . NodeScope );
106+ new Setting <>(
107+ sizeKey ,
108+ s -> Integer .toString (size ),
109+ s -> Setting .parseInt (s , 1 , applyHardSizeLimit (settings , name ), sizeKey ),
110+ properties );
74111 final String queueSizeKey = settingsKey (prefix , "queue_size" );
75- this .queueSizeSetting =
76- Setting .intSetting (queueSizeKey , queueSize , Setting .Property .NodeScope );
112+ this .queueSizeSetting = Setting .intSetting (queueSizeKey , queueSize , properties );
77113 }
78114
79115 @ Override
0 commit comments