11
11
import org .opensearch .common .settings .ClusterSettings ;
12
12
import org .opensearch .common .settings .Setting ;
13
13
import org .opensearch .common .settings .Settings ;
14
- import org .opensearch .common .unit .TimeValue ;
15
14
16
15
/**
17
16
* Main class to declare the QueryGroup feature related settings
18
17
*/
19
18
public class QueryGroupServiceSettings {
20
- private static final Long DEFAULT_RUN_INTERVAL_MILLIS = 1000l ;
21
19
private static final Double DEFAULT_NODE_LEVEL_MEMORY_REJECTION_THRESHOLD = 0.8 ;
22
20
private static final Double DEFAULT_NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD = 0.9 ;
23
21
private static final Double DEFAULT_NODE_LEVEL_CPU_REJECTION_THRESHOLD = 0.8 ;
@@ -27,32 +25,17 @@ public class QueryGroupServiceSettings {
27
25
public static final double NODE_LEVEL_CPU_CANCELLATION_THRESHOLD_MAX_VALUE = 0.95 ;
28
26
public static final double NODE_LEVEL_CPU_REJECTION_THRESHOLD_MAX_VALUE = 0.9 ;
29
27
30
- private TimeValue runIntervalMillis ;
31
28
private Double nodeLevelMemoryCancellationThreshold ;
32
29
private Double nodeLevelMemoryRejectionThreshold ;
33
30
private Double nodeLevelCpuCancellationThreshold ;
34
31
private Double nodeLevelCpuRejectionThreshold ;
35
- /**
36
- * Setting name for the run interval of QueryGroup service
37
- */
38
- public static final String SERVICE_RUN_INTERVAL_MILLIS_SETTING_NAME = "query_group.service.run_interval_millis" ;
39
- /**
40
- * Setting to control the run interval of QueryGroup service
41
- */
42
- private static final Setting <Long > QUERY_GROUP_RUN_INTERVAL_SETTING = Setting .longSetting (
43
- SERVICE_RUN_INTERVAL_MILLIS_SETTING_NAME ,
44
- DEFAULT_RUN_INTERVAL_MILLIS ,
45
- 1 ,
46
- Setting .Property .Dynamic ,
47
- Setting .Property .NodeScope
48
- );
49
32
50
33
/**
51
- * Setting name for node level memory rejection threshold for QueryGroup service
34
+ * Setting name for node level memory based rejection threshold for QueryGroup service
52
35
*/
53
36
public static final String NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME = "query_group.node.memory_rejection_threshold" ;
54
37
/**
55
- * Setting to control the memory rejection threshold
38
+ * Setting to control the memory based rejection threshold
56
39
*/
57
40
public static final Setting <Double > NODE_LEVEL_MEMORY_REJECTION_THRESHOLD = Setting .doubleSetting (
58
41
NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME ,
@@ -61,11 +44,11 @@ public class QueryGroupServiceSettings {
61
44
Setting .Property .NodeScope
62
45
);
63
46
/**
64
- * Setting name for node level cpu rejection threshold for QueryGroup service
47
+ * Setting name for node level cpu based rejection threshold for QueryGroup service
65
48
*/
66
49
public static final String NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME = "query_group.node.cpu_rejection_threshold" ;
67
50
/**
68
- * Setting to control the cpu rejection threshold
51
+ * Setting to control the cpu based rejection threshold
69
52
*/
70
53
public static final Setting <Double > NODE_LEVEL_CPU_REJECTION_THRESHOLD = Setting .doubleSetting (
71
54
NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME ,
@@ -74,11 +57,11 @@ public class QueryGroupServiceSettings {
74
57
Setting .Property .NodeScope
75
58
);
76
59
/**
77
- * Setting name for node level memory cancellation threshold for QueryGroup service
60
+ * Setting name for node level memory based cancellation threshold for QueryGroup service
78
61
*/
79
62
public static final String NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME = "query_group.node.memory_cancellation_threshold" ;
80
63
/**
81
- * Setting to control the memory cancellation threshold
64
+ * Setting to control the memory based cancellation threshold
82
65
*/
83
66
public static final Setting <Double > NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD = Setting .doubleSetting (
84
67
NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME ,
@@ -87,11 +70,11 @@ public class QueryGroupServiceSettings {
87
70
Setting .Property .NodeScope
88
71
);
89
72
/**
90
- * Setting name for node level cpu cancellation threshold for QueryGroup service
73
+ * Setting name for node level cpu based cancellation threshold for QueryGroup service
91
74
*/
92
75
public static final String NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME = "query_group.node.cpu_cancellation_threshold" ;
93
76
/**
94
- * Setting to control the cpu cancellation threshold
77
+ * Setting to control the cpu based cancellation threshold
95
78
*/
96
79
public static final Setting <Double > NODE_LEVEL_CPU_CANCELLATION_THRESHOLD = Setting .doubleSetting (
97
80
NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME ,
@@ -106,7 +89,6 @@ public class QueryGroupServiceSettings {
106
89
* @param clusterSettings - QueryGroup cluster settings
107
90
*/
108
91
public QueryGroupServiceSettings (Settings settings , ClusterSettings clusterSettings ) {
109
- runIntervalMillis = new TimeValue (QUERY_GROUP_RUN_INTERVAL_SETTING .get (settings ));
110
92
nodeLevelMemoryCancellationThreshold = NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD .get (settings );
111
93
nodeLevelMemoryRejectionThreshold = NODE_LEVEL_MEMORY_REJECTION_THRESHOLD .get (settings );
112
94
nodeLevelCpuCancellationThreshold = NODE_LEVEL_CPU_CANCELLATION_THRESHOLD .get (settings );
@@ -132,24 +114,16 @@ public QueryGroupServiceSettings(Settings settings, ClusterSettings clusterSetti
132
114
}
133
115
134
116
/**
135
- * Method to get runInterval for QueryGroup service
136
- * @return runInterval in milliseconds for QueryGroup service
137
- */
138
- public TimeValue getRunIntervalMillis () {
139
- return runIntervalMillis ;
140
- }
141
-
142
- /**
143
- * Method to get the node level memory cancellation threshold
144
- * @return current node level memory cancellation threshold
117
+ * Method to get the node level memory based cancellation threshold
118
+ * @return current node level memory based cancellation threshold
145
119
*/
146
120
public Double getNodeLevelMemoryCancellationThreshold () {
147
121
return nodeLevelMemoryCancellationThreshold ;
148
122
}
149
123
150
124
/**
151
- * Method to set the node level memory cancellation threshold
152
- * @param nodeLevelMemoryCancellationThreshold sets the new node level memory cancellation threshold
125
+ * Method to set the node level memory based cancellation threshold
126
+ * @param nodeLevelMemoryCancellationThreshold sets the new node level memory based cancellation threshold
153
127
* @throws IllegalArgumentException if the value is > 0.95 and cancellation < rejection threshold
154
128
*/
155
129
public void setNodeLevelMemoryCancellationThreshold (Double nodeLevelMemoryCancellationThreshold ) {
@@ -170,16 +144,16 @@ public void setNodeLevelMemoryCancellationThreshold(Double nodeLevelMemoryCancel
170
144
}
171
145
172
146
/**
173
- * Method to get the node level cpu cancellation threshold
174
- * @return current node level cpu cancellation threshold
147
+ * Method to get the node level cpu based cancellation threshold
148
+ * @return current node level cpu based cancellation threshold
175
149
*/
176
150
public Double getNodeLevelCpuCancellationThreshold () {
177
151
return nodeLevelCpuCancellationThreshold ;
178
152
}
179
153
180
154
/**
181
- * Method to set the node level cpu cancellation threshold
182
- * @param nodeLevelCpuCancellationThreshold sets the new node level cpu cancellation threshold
155
+ * Method to set the node level cpu based cancellation threshold
156
+ * @param nodeLevelCpuCancellationThreshold sets the new node level cpu based cancellation threshold
183
157
* @throws IllegalArgumentException if the value is > 0.95 and cancellation < rejection threshold
184
158
*/
185
159
public void setNodeLevelCpuCancellationThreshold (Double nodeLevelCpuCancellationThreshold ) {
@@ -200,16 +174,16 @@ public void setNodeLevelCpuCancellationThreshold(Double nodeLevelCpuCancellation
200
174
}
201
175
202
176
/**
203
- * Method to get the memory node level rejection threshold
204
- * @return the current memory node level rejection threshold
177
+ * Method to get the memory based node level rejection threshold
178
+ * @return the current memory based node level rejection threshold
205
179
*/
206
180
public Double getNodeLevelMemoryRejectionThreshold () {
207
181
return nodeLevelMemoryRejectionThreshold ;
208
182
}
209
183
210
184
/**
211
- * Method to set the node level memory rejection threshold
212
- * @param nodeLevelMemoryRejectionThreshold sets the new memory rejection threshold
185
+ * Method to set the node level memory based rejection threshold
186
+ * @param nodeLevelMemoryRejectionThreshold sets the new memory based rejection threshold
213
187
* @throws IllegalArgumentException if rejection > 0.90 and rejection < cancellation threshold
214
188
*/
215
189
public void setNodeLevelMemoryRejectionThreshold (Double nodeLevelMemoryRejectionThreshold ) {
@@ -230,16 +204,16 @@ public void setNodeLevelMemoryRejectionThreshold(Double nodeLevelMemoryRejection
230
204
}
231
205
232
206
/**
233
- * Method to get the cpu node level rejection threshold
234
- * @return the current cpu node level rejection threshold
207
+ * Method to get the cpu based node level rejection threshold
208
+ * @return the current cpu based node level rejection threshold
235
209
*/
236
210
public Double getNodeLevelCpuRejectionThreshold () {
237
211
return nodeLevelCpuRejectionThreshold ;
238
212
}
239
213
240
214
/**
241
- * Method to set the node level cpu rejection threshold
242
- * @param nodeLevelCpuRejectionThreshold sets the new cpu rejection threshold
215
+ * Method to set the node level cpu based rejection threshold
216
+ * @param nodeLevelCpuRejectionThreshold sets the new cpu based rejection threshold
243
217
* @throws IllegalArgumentException if rejection > 0.90 and rejection < cancellation threshold
244
218
*/
245
219
public void setNodeLevelCpuRejectionThreshold (Double nodeLevelCpuRejectionThreshold ) {
0 commit comments