Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Kuanysh Aimurzinov <[email protected]>
  • Loading branch information
Kuanysh-kst committed Jun 21, 2023
1 parent b335b84 commit adfeca8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public synchronized <T> void addSettingsUpdateConsumer(Setting<T> setting, Consu
throw new SettingsException("Setting is not registered for key [" + setting.getKey() + "]");
}
addSettingsUpdater(setting.newUpdater(consumer, logger, validator));
}
}

/**
* Adds a settings consumer that is only executed if any setting in the supplied list of settings is changed. In that case all the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@ TransportResponse handleAddSettingsUpdateConsumerRequest(AddSettingsUpdateConsum

// Register setting update consumer with callback method to extension
if (setting.hasIndexScope()) {
clusterService.getClusterSettings()
.addSettingsUpdateConsumer(settingForUpdateConsumer, (data) -> {
logger.debug("Sending extension request type: " + updateSettingsRequestType);
UpdateSettingsResponseHandler updateSettingsResponseHandler = new UpdateSettingsResponseHandler();
transportService.sendRequest(
extensionNode,
updateSettingsRequestType,
new UpdateSettingsRequest(settingType, setting, data),
updateSettingsResponseHandler
);
});
clusterService.getClusterSettings().addSettingsUpdateConsumer(settingForUpdateConsumer, (data) -> {
logger.debug("Sending extension request type: " + updateSettingsRequestType);
UpdateSettingsResponseHandler updateSettingsResponseHandler = new UpdateSettingsResponseHandler();
transportService.sendRequest(
extensionNode,
updateSettingsRequestType,
new UpdateSettingsRequest(settingType, setting, data),
updateSettingsResponseHandler
);
});
}
if (setting.hasNodeScope()) {
clusterService.getClusterSettings()
Expand Down

0 comments on commit adfeca8

Please sign in to comment.