Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unused code in the search backpressure package #15518

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Deprecated

### Removed
- Remove some unused code in the search backpressure package ([#15518](https://github.com/opensearch-project/OpenSearch/pull/15518))

### Fixed
- Fix constraint bug which allows more primary shards than average primary shards per index ([#14908](https://github.com/opensearch-project/OpenSearch/pull/14908))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public class SearchBackpressureService extends AbstractLifecycleComponent implem
private final SearchBackpressureSettings settings;
private final TaskResourceTrackingService taskResourceTrackingService;
private final ThreadPool threadPool;
private final LongSupplier timeNanosSupplier;

private final NodeDuressTrackers nodeDuressTrackers;
private final Map<Class<? extends SearchBackpressureTask>, TaskResourceUsageTrackers> taskTrackers;
Expand Down Expand Up @@ -150,7 +149,6 @@ public SearchBackpressureService(
this.taskResourceTrackingService = taskResourceTrackingService;
this.taskResourceTrackingService.addTaskCompletionListener(this);
this.threadPool = threadPool;
this.timeNanosSupplier = timeNanosSupplier;
reta marked this conversation as resolved.
Show resolved Hide resolved
this.nodeDuressTrackers = nodeDuressTrackers;
this.taskManager = taskManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@
*/
public class SearchShardTaskSettings {
private final List<CancellationSettingsListener> listeners = new ArrayList<>();
private final ClusterSettings clusterSettings;

private static class Defaults {
private static final double CANCELLATION_RATIO = 0.1;
private static final double CANCELLATION_RATE = 0.003;
private static final double CANCELLATION_BURST = 10.0;
private static final double TOTAL_HEAP_PERCENT_THRESHOLD = 0.05;
private static final long CPU_TIME_MILLIS_THRESHOLD = 15000;
private static final long ELAPSED_TIME_MILLIS_THRESHOLD = 30000;
Expand Down Expand Up @@ -165,7 +161,6 @@ public SearchShardTaskSettings(Settings settings, ClusterSettings clusterSetting
this.cancellationRatio = SETTING_CANCELLATION_RATIO.get(settings);
this.cancellationRate = SETTING_CANCELLATION_RATE.get(settings);
this.cancellationBurst = SETTING_CANCELLATION_BURST.get(settings);
this.clusterSettings = clusterSettings;

clusterSettings.addSettingsUpdateConsumer(SETTING_TOTAL_HEAP_PERCENT_THRESHOLD, this::setTotalHeapPercentThreshold);
clusterSettings.addSettingsUpdateConsumer(SETTING_CPU_TIME_MILLIS_THRESHOLD, this::setCpuTimeMillisThreshold);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

public class SearchTaskSettings {
private final List<CancellationSettingsListener> listeners = new ArrayList<>();
private final ClusterSettings clusterSettings;

private static class Defaults {
private static final double CANCELLATION_RATIO = 0.1;
Expand Down Expand Up @@ -166,7 +165,6 @@ public SearchTaskSettings(Settings settings, ClusterSettings clusterSettings) {
this.cancellationRatio = SETTING_CANCELLATION_RATIO.get(settings);
this.cancellationRate = SETTING_CANCELLATION_RATE.get(settings);
this.cancellationBurst = SETTING_CANCELLATION_BURST.get(settings);
this.clusterSettings = clusterSettings;

clusterSettings.addSettingsUpdateConsumer(SETTING_TOTAL_HEAP_PERCENT_THRESHOLD, this::setTotalHeapPercentThreshold);
clusterSettings.addSettingsUpdateConsumer(SETTING_CPU_TIME_MILLIS_THRESHOLD, this::setCpuTimeMillisThreshold);
Expand Down
Loading