Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ruirui Zhang <[email protected]>
  • Loading branch information
ruai0511 committed Aug 21, 2024
1 parent dc8a8f6 commit 47b91d6
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 103 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Add `rangeQuery` and `regexpQuery` for `constant_keyword` field type ([#14711](https://github.com/opensearch-project/OpenSearch/pull/14711))
- Add took time to request nodes stats ([#15054](https://github.com/opensearch-project/OpenSearch/pull/15054))
- [Workload Management] Add Get QueryGroup API Logic ([14709](https://github.com/opensearch-project/OpenSearch/pull/14709))
- [Workload Management] Add QueryGroupServiceSettings ([#15028](https://github.com/opensearch-project/OpenSearch/pull/15028))
- [Workload Management] Add Settings for Workload Management feature ([#15028](https://github.com/opensearch-project/OpenSearch/pull/15028))
- [Workload Management] QueryGroup resource tracking framework changes ([#13897](https://github.com/opensearch-project/OpenSearch/pull/13897))
- Support filtering on a large list encoded by bitmap ([#14774](https://github.com/opensearch-project/OpenSearch/pull/14774))
- Add slice execution listeners to SearchOperationListener interface ([#15153](https://github.com/opensearch-project/OpenSearch/pull/15153))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
import org.opensearch.search.backpressure.settings.SearchShardTaskSettings;
import org.opensearch.search.backpressure.settings.SearchTaskSettings;
import org.opensearch.search.fetch.subphase.highlight.FastVectorHighlighter;
import org.opensearch.search.query_group.QueryGroupServiceSettings;
import org.opensearch.snapshots.InternalSnapshotsInfoService;
import org.opensearch.snapshots.SnapshotsService;
import org.opensearch.tasks.TaskCancellationMonitoringSettings;
Expand All @@ -174,6 +173,7 @@
import org.opensearch.transport.SniffConnectionStrategy;
import org.opensearch.transport.TransportSettings;
import org.opensearch.watcher.ResourceWatcherService;
import org.opensearch.wlm.WorkloadManagementSettings;

import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -769,11 +769,11 @@ public void apply(Settings value, Settings current, Settings previous) {

SystemTemplatesService.SETTING_APPLICATION_BASED_CONFIGURATION_TEMPLATES_ENABLED,

// QueryGroup settings
QueryGroupServiceSettings.NODE_LEVEL_CPU_REJECTION_THRESHOLD,
QueryGroupServiceSettings.NODE_LEVEL_CPU_CANCELLATION_THRESHOLD,
QueryGroupServiceSettings.NODE_LEVEL_MEMORY_REJECTION_THRESHOLD,
QueryGroupServiceSettings.NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD
// WorkloadManagement settings
WorkloadManagementSettings.NODE_LEVEL_CPU_REJECTION_THRESHOLD,
WorkloadManagementSettings.NODE_LEVEL_CPU_CANCELLATION_THRESHOLD,
WorkloadManagementSettings.NODE_LEVEL_MEMORY_REJECTION_THRESHOLD,
WorkloadManagementSettings.NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD
)
)
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
* compatible open source license.
*/

package org.opensearch.search.query_group;
package org.opensearch.wlm;

import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;

/**
* Main class to declare the QueryGroup feature related settings
* Main class to declare Workload Management related settings
*/
public class QueryGroupServiceSettings {
public class WorkloadManagementSettings {
private static final Double DEFAULT_NODE_LEVEL_MEMORY_REJECTION_THRESHOLD = 0.8;
private static final Double DEFAULT_NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD = 0.9;
private static final Double DEFAULT_NODE_LEVEL_CPU_REJECTION_THRESHOLD = 0.8;
Expand All @@ -33,7 +33,7 @@ public class QueryGroupServiceSettings {
/**
* Setting name for node level memory based rejection threshold for QueryGroup service
*/
public static final String NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME = "query_group.node.memory_rejection_threshold";
public static final String NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME = "wlm.query_group.node.memory_rejection_threshold";
/**
* Setting to control the memory based rejection threshold
*/
Expand All @@ -46,7 +46,7 @@ public class QueryGroupServiceSettings {
/**
* Setting name for node level cpu based rejection threshold for QueryGroup service
*/
public static final String NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME = "query_group.node.cpu_rejection_threshold";
public static final String NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME = "wlm.query_group.node.cpu_rejection_threshold";
/**
* Setting to control the cpu based rejection threshold
*/
Expand All @@ -59,7 +59,7 @@ public class QueryGroupServiceSettings {
/**
* Setting name for node level memory based cancellation threshold for QueryGroup service
*/
public static final String NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME = "query_group.node.memory_cancellation_threshold";
public static final String NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME = "wlm.query_group.node.memory_cancellation_threshold";
/**
* Setting to control the memory based cancellation threshold
*/
Expand All @@ -72,7 +72,7 @@ public class QueryGroupServiceSettings {
/**
* Setting name for node level cpu based cancellation threshold for QueryGroup service
*/
public static final String NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME = "query_group.node.cpu_cancellation_threshold";
public static final String NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME = "wlm.query_group.node.cpu_cancellation_threshold";
/**
* Setting to control the cpu based cancellation threshold
*/
Expand All @@ -88,7 +88,7 @@ public class QueryGroupServiceSettings {
* @param settings - QueryGroup service settings
* @param clusterSettings - QueryGroup cluster settings
*/
public QueryGroupServiceSettings(Settings settings, ClusterSettings clusterSettings) {
public WorkloadManagementSettings(Settings settings, ClusterSettings clusterSettings) {
nodeLevelMemoryCancellationThreshold = NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD.get(settings);
nodeLevelMemoryRejectionThreshold = NODE_LEVEL_MEMORY_REJECTION_THRESHOLD.get(settings);
nodeLevelCpuCancellationThreshold = NODE_LEVEL_CPU_CANCELLATION_THRESHOLD.get(settings);
Expand Down Expand Up @@ -129,7 +129,7 @@ public Double getNodeLevelMemoryCancellationThreshold() {
public void setNodeLevelMemoryCancellationThreshold(Double nodeLevelMemoryCancellationThreshold) {
if (Double.compare(nodeLevelMemoryCancellationThreshold, NODE_LEVEL_MEMORY_CANCELLATION_THRESHOLD_MAX_VALUE) > 0) {
throw new IllegalArgumentException(
NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME + " value should not be greater than 0.95 as it pose a threat of node drop"
NODE_MEMORY_CANCELLATION_THRESHOLD_SETTING_NAME + " value cannot be greater than 0.95 as it can result in a node drop"
);
}

Expand Down Expand Up @@ -159,7 +159,7 @@ public Double getNodeLevelCpuCancellationThreshold() {
public void setNodeLevelCpuCancellationThreshold(Double nodeLevelCpuCancellationThreshold) {
if (Double.compare(nodeLevelCpuCancellationThreshold, NODE_LEVEL_CPU_CANCELLATION_THRESHOLD_MAX_VALUE) > 0) {
throw new IllegalArgumentException(
NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME + " value should not be greater than 0.95 as it pose a threat of node drop"
NODE_CPU_CANCELLATION_THRESHOLD_SETTING_NAME + " value cannot be greater than 0.95 as it can result in a node drop"
);
}

Expand Down Expand Up @@ -189,7 +189,7 @@ public Double getNodeLevelMemoryRejectionThreshold() {
public void setNodeLevelMemoryRejectionThreshold(Double nodeLevelMemoryRejectionThreshold) {
if (Double.compare(nodeLevelMemoryRejectionThreshold, NODE_LEVEL_MEMORY_REJECTION_THRESHOLD_MAX_VALUE) > 0) {
throw new IllegalArgumentException(
NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME + " value not be greater than 0.90 as it pose a threat of node drop"
NODE_MEMORY_REJECTION_THRESHOLD_SETTING_NAME + " value cannot be greater than 0.90 as it can result in a node drop"
);
}

Expand Down Expand Up @@ -219,7 +219,7 @@ public Double getNodeLevelCpuRejectionThreshold() {
public void setNodeLevelCpuRejectionThreshold(Double nodeLevelCpuRejectionThreshold) {
if (Double.compare(nodeLevelCpuRejectionThreshold, NODE_LEVEL_CPU_REJECTION_THRESHOLD_MAX_VALUE) > 0) {
throw new IllegalArgumentException(
NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME + " value not be greater than 0.90 as it pose a threat of node drop"
NODE_CPU_REJECTION_THRESHOLD_SETTING_NAME + " value cannot be greater than 0.90 as it can result in a node drop"
);
}

Expand Down
Loading

0 comments on commit 47b91d6

Please sign in to comment.