-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Feature/extensions] Adding support to register settings dynamically #3753
[Feature/extensions] Adding support to register settings dynamically #3753
Conversation
Signed-off-by: Sarat Vemulapalli <[email protected]>
Signed-off-by: Sarat Vemulapalli <[email protected]>
Signed-off-by: Sarat Vemulapalli <[email protected]>
Tagging: @kartg (follow up of our conversation) |
Gradle Check (Jenkins) Run Completed with:
|
Any downsides for this implementation at runtime? I hope we can get this onto main. |
This is a bug #2772 on feature/extensions branch.
|
I am looking for feedback as well. As far as I understand it feels safe enough. |
server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/settings/ClusterSettings.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/common/settings/SettingsModuleTests.java
Show resolved
Hide resolved
server/src/test/java/org/opensearch/common/settings/SettingsModuleTests.java
Show resolved
Hide resolved
Signed-off-by: Sarat Vemulapalli <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments inline. It looks like this is still a work in progress so holding off on clicking "approve".
server/src/main/java/org/opensearch/common/settings/AbstractScopedSettings.java
Show resolved
Hide resolved
server/src/test/java/org/opensearch/common/settings/SettingsModuleTests.java
Show resolved
Hide resolved
Signed-off-by: Sarat Vemulapalli <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Sarat Vemulapalli <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Gradle check failing on Jenkins. I think I read somewhere that Jenkins configuration has changed, so that's unrelated to this PR |
@@ -144,6 +144,15 @@ protected AbstractScopedSettings(Settings nodeSettings, Settings scopeSettings, | |||
settingUpdaters.addAll(other.settingUpdaters); | |||
} | |||
|
|||
protected boolean registerSetting(Setting<?> setting) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that ClusterSettings
and IndexScopedSettings
are the only two subclasses of this class, why not simply make this method public
and avoid the super
calls in two places?
if (setting.hasNodeScope()) { | ||
return clusterSettings.registerSetting(setting); | ||
} | ||
if (setting.hasIndexScope()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick - else if
here, unless it's possible for a setting to be both NodeScope
and IndexScope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
if (setting.hasIndexScope()) { | ||
return indexScopedSettings.registerSetting(setting); | ||
} | ||
logger.info("Registered new Setting: " + setting.getKey() + " successfully "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick - This log line will be printed inconsistently since there are return
statements above. Consider moving this to the caller, or before the return statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. The return came later after the feedback.
Sure will send out a follow up.
Description
Adding support to register dynamic settings.
For plugins/extensions, they can define their own settings which are propagated across the cluster.
This PR adds support to register
Node
Scope orIndex
Scope settings at anytime.This feature support unlocks a part of extensions hot swap.
This is a recreate of PR: #3529
Issues Resolved
#3434
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.