Skip to content
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

Convert path.data to String setting instead of List #72282

Merged
merged 6 commits into from
Apr 27, 2021

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 27, 2021

Since multiple data path support has been removed, the Setting no longer
needs to support multiple values. This commit converts the
PATH_DATA_SETTING to a String setting from List.

relates #71205

Since multiple data path support has been removed, the Setting no longer
needs to support multiple values. This commit converts the
PATH_DATA_SETTING to a String setting from List<String>.

relates elastic#71205
@rjernst rjernst added :Core/Infra/Core Core issues without another label >refactoring v8.0.0 labels Apr 27, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Apr 27, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@rjernst rjernst requested a review from jasontedor April 27, 2021 00:07
Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The core production change looks good. Skimmed the rest, if the compiler is happy, I’m happy. Left one comment.

@@ -50,7 +50,7 @@ public void setup() throws IOException {
LogConfigurator.setNodeName("test");
Settings settings = Settings.builder()
.put(Environment.PATH_HOME_SETTING.getKey(), path)
.putList(Environment.PATH_DATA_SETTING.getKey(), paths)
.put(Environment.PATH_DATA_SETTING.getKey(), path.resolve("data"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is paths dead now?

@@ -179,7 +170,7 @@ public Settings settings() {
* The data location.
*/
public Path[] dataFiles() {
return dataFiles;
return new Path[] { dataFile };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we (naively) inline this method right now, or in an imminent follow-up? That would leave us with a bunch of places where we do things like this:

        for (Path dataPath : new Path[]{environment.dataFile()}) {

I think this is preferable to using environment.dataFiles()[0] to get hold of the unique data path using the knowledge that it's always a singleton array. Unrolling loops like this is obviously correct (indeed IntelliJ will do it for you).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we discussed the approach here to not try to do MDP legacy code removal all at once, keeping each change relatively self-contained, and this is one we agreed to hold for a follow-up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acked. An imminent follow-up, or do we expect to merge things like #72278 first? We call this method in <30 places, so it's a pretty small change that IMO makes the subsequent larger cleanups much neater.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, after this change, although we didn’t discuss a dependency on #72278. You’re making a compelling case there should be. Thank you!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #72327

@rjernst rjernst merged commit d933ecd into elastic:master Apr 27, 2021
@rjernst rjernst deleted the mdp11 branch April 27, 2021 15:29
@rjernst rjernst mentioned this pull request Sep 30, 2021
17 tasks
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Oct 13, 2021
…72282)"

This reverts commit d933ecd.

The revert had two conflicts. The first was very minor in JoinHelper.
The second was several tests in PersistedClusterStateServiceTests.

relates elastic#78525
relates elastic#71205
rjernst added a commit that referenced this pull request Oct 14, 2021
…#79091)

This reverts commit d933ecd.

The revert had two conflicts. The first was very minor in JoinHelper.
The second was several tests in PersistedClusterStateServiceTests.

relates #78525
relates #71205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants