Skip to content

Commit

Permalink
Removing cluster setting as part of ThreadPool and just registering a…
Browse files Browse the repository at this point in the history
… listener on it

Signed-off-by: Gaurav Bafna <[email protected]>
  • Loading branch information
gbbafna committed Oct 11, 2024
1 parent 4bedb9c commit b161100
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ protected Node(
additionalSettingsFilter,
settingsUpgraders
);
threadPool.setClusterSettings(settingsModule.getClusterSettings());
threadPool.registerClusterSettingsListeners(settingsModule.getClusterSettings());
scriptModule.registerClusterSettingsListeners(scriptService, settingsModule.getClusterSettings());
final NetworkService networkService = new NetworkService(
getCustomNameResolvers(pluginsService.filterPlugins(DiscoveryPlugin.class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ public static ThreadPoolType fromType(String type) {

private final ScheduledThreadPoolExecutor scheduler;

private ClusterSettings clusterSettings = null;

public Collection<ExecutorBuilder> builders() {
return Collections.unmodifiableCollection(builders.values());
}
Expand Down Expand Up @@ -423,9 +421,8 @@ public Info info(String name) {
return holder.info;
}

public void setClusterSettings(ClusterSettings clusterSettings) {
this.clusterSettings = clusterSettings;
this.clusterSettings.addSettingsUpdateConsumer(CLUSTER_THREAD_POOL_SIZE_SETTING, this::setThreadPool, this::validateSetting);
public void registerClusterSettingsListeners(ClusterSettings clusterSettings) {
clusterSettings.addSettingsUpdateConsumer(CLUSTER_THREAD_POOL_SIZE_SETTING, this::setThreadPool, this::validateSetting);
}

/*
Expand Down

0 comments on commit b161100

Please sign in to comment.