Core: Remove settings from AbstractComponent#35140
Merged
nik9000 merged 1 commit intoelastic:masterfrom Nov 1, 2018
Merged
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
Collaborator
|
Pinging @elastic/es-core-infra |
Member
Author
|
@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
approved these changes
Oct 31, 2018
| /** | ||
| * Test for EC2 network.host settings. | ||
| * <p> | ||
| * Warning: This test doesn't assert that the exceptions are thrown. |
Member
There was a problem hiding this comment.
can you open up a issue for this test and assign it to someone? maybe the original author?
| import org.elasticsearch.common.settings.Settings; | ||
|
|
||
| /** | ||
| * @deprecated declare your own logger |
nik9000
added a commit
that referenced
this pull request
Nov 2, 2018
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
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Nov 13, 2018
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.
DaveCTurner
added a commit
that referenced
this pull request
Nov 13, 2018
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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