Skip to content

Commit

Permalink
Remove some unused code in the search backpressure package (opensearc…
Browse files Browse the repository at this point in the history
…h-project#15518)

* Remove some unused code in the search backpressure package

Signed-off-by: Gao Binlong <[email protected]>

* Add change log

Signed-off-by: Gao Binlong <[email protected]>

* Modify change log

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
  • Loading branch information
gaobinlong authored and dk2k committed Oct 21, 2024
1 parent ee29b5b commit 0862dcf
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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;
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

0 comments on commit 0862dcf

Please sign in to comment.