-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Core: Remove settings from AbstractComponent #35140
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
Core: Remove settings from AbstractComponent #35140
Conversation
Stop passing `Settings` to `AbstractComponent`'s ctor. This allows us to stop passing around `Settings` in a *ton* of places. While this change touches many files, it touches them all in fairly small, mechanical ways, doing a few things per file: 1. Drop the `super(settings);` line on everything that extends `AbstractComponent`. 2. Drop the `settings` argument to the ctor if it is no longer used. 3. If the file doesn't use `logger` then drop `extends AbstractComponent` from it. 4. Clean up all compilation failure caused by the `settings` removal and drop any now unused `settings` isntances and method arguments. I've intentionally *not* removed the `settings` argument from a few files: 1. TransportAction 2. AbstractLifecycleComponent 3. BaseRestHandler These files don't *need* `settings` either, but this change is large enough as is. Relates to elastic#34488
|
Pinging @elastic/es-core-infra |
|
@jaymode this one is a bit of a monster and you've been so good about my previous ones on this path. Could you look it? I'm sorry in advance for the number of files. At least it isn't that many lines. |
jaymode
left a comment
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.
I left one request, otherwise LGTM. @nik9000 thank you for keeping these digestible.
| /** | ||
| * Test for EC2 network.host settings. | ||
| * <p> | ||
| * Warning: This test doesn't assert that the exceptions are thrown. |
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.
can you open up a issue for this test and assign it to someone? maybe the original author?
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.
| import org.elasticsearch.common.settings.Settings; | ||
|
|
||
| /** | ||
| * @deprecated declare your own logger |
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.
👍
Stop passing `Settings` to `AbstractComponent`'s ctor. This allows us to stop passing around `Settings` in a *ton* of places. While this change touches many files, it touches them all in fairly small, mechanical ways, doing a few things per file: 1. Drop the `super(settings);` line on everything that extends `AbstractComponent`. 2. Drop the `settings` argument to the ctor if it is no longer used. 3. If the file doesn't use `logger` then drop `extends AbstractComponent` from it. 4. Clean up all compilation failure caused by the `settings` removal and drop any now unused `settings` isntances and method arguments. I've intentionally *not* removed the `settings` argument from a few files: 1. TransportAction 2. AbstractLifecycleComponent 3. BaseRestHandler These files don't *need* `settings` either, but this change is large enough as is. Relates to #34488
AbstractComponent was deprecated in elastic#35140 and is looking like it will be removed at some point by elastic#34888. Today all it does is provide a logger. This change removes the usages of AbstractComponent that live solely in the zen2 feature branch to avoid some future merge pain, and replaces it where necessary with some directly-created loggers.
AbstractComponent was deprecated in #35140 and is looking like it will be removed at some point by #34888. Today all it does is provide a logger. This change removes the usages of AbstractComponent that live solely in the zen2 feature branch to avoid some future merge pain, and replaces it where necessary with some directly-created loggers.
Stop passing
SettingstoAbstractComponent's ctor. This allows us tostop passing around
Settingsin a ton of places. While this changetouches many files, it touches them all in fairly small, mechanical
ways, doing a few things per file:
super(settings);line on everything that extendsAbstractComponent.settingsargument to the ctor if it is no longer used.loggerthen dropextends AbstractComponentfrom it.settingsremovaland drop any now unused
settingsisntances and method arguments.I've intentionally not removed the
settingsargument from a fewfiles:
These files don't need
settingseither, but this change is largeenough as is.
Relates to #34488