Skip to content

Commit 0b47585

Browse files
committed
remove QUERY_GROUP_RUN_INTERVAL_SETTING as we'll define it in QueryGroupService
Signed-off-by: Ruirui Zhang <[email protected]>
1 parent 6af41f3 commit 0b47585

File tree

1 file changed

+24
-50
lines changed

1 file changed

+24
-50
lines changed

server/src/main/java/org/opensearch/search/query_group/QueryGroupServiceSettings.java

Lines changed: 24 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
import org.opensearch.common.settings.ClusterSettings;
1212
import org.opensearch.common.settings.Setting;
1313
import org.opensearch.common.settings.Settings;
14-
import org.opensearch.common.unit.TimeValue;
1514

1615
/**
1716
* Main class to declare the QueryGroup feature related settings
1817
*/
1918
public class QueryGroupServiceSettings {
20-
private static final Long DEFAULT_RUN_INTERVAL_MILLIS = 1000l;
2119
private static final Double DEFAULT_NODE_LEVEL_MEMORY_REJECTION_THRESHOLD = 0.8;
2220
private static final Double DEFAULT_NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD = 0.9;
2321
private static final Double DEFAULT_NODE_LEVEL_CPU_REJECTION_THRESHOLD = 0.8;
@@ -27,32 +25,17 @@ public class QueryGroupServiceSettings {
2725
public static final double NODE_LEVEL_CPU_CANCELLATION_THRESHOLD_MAX_VALUE = 0.95;
2826
public static final double NODE_LEVEL_CPU_REJECTION_THRESHOLD_MAX_VALUE = 0.9;
2927

30-
private TimeValue runIntervalMillis;
3128
private Double nodeLevelMemoryCancellationThreshold;
3229
private Double nodeLevelMemoryRejectionThreshold;
3330
private Double nodeLevelCpuCancellationThreshold;
3431
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-
);
4932

5033
/**
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
5235
*/
5336
public static final String NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME = "query_group.node.memory_rejection_threshold";
5437
/**
55-
* Setting to control the memory rejection threshold
38+
* Setting to control the memory based rejection threshold
5639
*/
5740
public static final Setting<Double> NODE_LEVEL_MEMORY_REJECTION_THRESHOLD = Setting.doubleSetting(
5841
NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME,
@@ -61,11 +44,11 @@ public class QueryGroupServiceSettings {
6144
Setting.Property.NodeScope
6245
);
6346
/**
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
6548
*/
6649
public static final String NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME = "query_group.node.cpu_rejection_threshold";
6750
/**
68-
* Setting to control the cpu rejection threshold
51+
* Setting to control the cpu based rejection threshold
6952
*/
7053
public static final Setting<Double> NODE_LEVEL_CPU_REJECTION_THRESHOLD = Setting.doubleSetting(
7154
NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME,
@@ -74,11 +57,11 @@ public class QueryGroupServiceSettings {
7457
Setting.Property.NodeScope
7558
);
7659
/**
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
7861
*/
7962
public static final String NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME = "query_group.node.memory_cancellation_threshold";
8063
/**
81-
* Setting to control the memory cancellation threshold
64+
* Setting to control the memory based cancellation threshold
8265
*/
8366
public static final Setting<Double> NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD = Setting.doubleSetting(
8467
NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME,
@@ -87,11 +70,11 @@ public class QueryGroupServiceSettings {
8770
Setting.Property.NodeScope
8871
);
8972
/**
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
9174
*/
9275
public static final String NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME = "query_group.node.cpu_cancellation_threshold";
9376
/**
94-
* Setting to control the cpu cancellation threshold
77+
* Setting to control the cpu based cancellation threshold
9578
*/
9679
public static final Setting<Double> NODE_LEVEL_CPU_CANCELLATION_THRESHOLD = Setting.doubleSetting(
9780
NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME,
@@ -106,7 +89,6 @@ public class QueryGroupServiceSettings {
10689
* @param clusterSettings - QueryGroup cluster settings
10790
*/
10891
public QueryGroupServiceSettings(Settings settings, ClusterSettings clusterSettings) {
109-
runIntervalMillis = new TimeValue(QUERY_GROUP_RUN_INTERVAL_SETTING.get(settings));
11092
nodeLevelMemoryCancellationThreshold = NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD.get(settings);
11193
nodeLevelMemoryRejectionThreshold = NODE_LEVEL_MEMORY_REJECTION_THRESHOLD.get(settings);
11294
nodeLevelCpuCancellationThreshold = NODE_LEVEL_CPU_CANCELLATION_THRESHOLD.get(settings);
@@ -132,24 +114,16 @@ public QueryGroupServiceSettings(Settings settings, ClusterSettings clusterSetti
132114
}
133115

134116
/**
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
145119
*/
146120
public Double getNodeLevelMemoryCancellationThreshold() {
147121
return nodeLevelMemoryCancellationThreshold;
148122
}
149123

150124
/**
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
153127
* @throws IllegalArgumentException if the value is &gt; 0.95 and cancellation &lt; rejection threshold
154128
*/
155129
public void setNodeLevelMemoryCancellationThreshold(Double nodeLevelMemoryCancellationThreshold) {
@@ -170,16 +144,16 @@ public void setNodeLevelMemoryCancellationThreshold(Double nodeLevelMemoryCancel
170144
}
171145

172146
/**
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
175149
*/
176150
public Double getNodeLevelCpuCancellationThreshold() {
177151
return nodeLevelCpuCancellationThreshold;
178152
}
179153

180154
/**
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
183157
* @throws IllegalArgumentException if the value is &gt; 0.95 and cancellation &lt; rejection threshold
184158
*/
185159
public void setNodeLevelCpuCancellationThreshold(Double nodeLevelCpuCancellationThreshold) {
@@ -200,16 +174,16 @@ public void setNodeLevelCpuCancellationThreshold(Double nodeLevelCpuCancellation
200174
}
201175

202176
/**
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
205179
*/
206180
public Double getNodeLevelMemoryRejectionThreshold() {
207181
return nodeLevelMemoryRejectionThreshold;
208182
}
209183

210184
/**
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
213187
* @throws IllegalArgumentException if rejection &gt; 0.90 and rejection &lt; cancellation threshold
214188
*/
215189
public void setNodeLevelMemoryRejectionThreshold(Double nodeLevelMemoryRejectionThreshold) {
@@ -230,16 +204,16 @@ public void setNodeLevelMemoryRejectionThreshold(Double nodeLevelMemoryRejection
230204
}
231205

232206
/**
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
235209
*/
236210
public Double getNodeLevelCpuRejectionThreshold() {
237211
return nodeLevelCpuRejectionThreshold;
238212
}
239213

240214
/**
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
243217
* @throws IllegalArgumentException if rejection &gt; 0.90 and rejection &lt; cancellation threshold
244218
*/
245219
public void setNodeLevelCpuRejectionThreshold(Double nodeLevelCpuRejectionThreshold) {

0 commit comments

Comments
 (0)