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

Make Environment.dataFiles singular #72327

Merged
merged 3 commits into from
Apr 28, 2021
Merged

Make Environment.dataFiles singular #72327

merged 3 commits into from
Apr 28, 2021

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 27, 2021

The path.data setting is now a singular string, but the method
dataFiles() that gives access to the path is still an array. This commit
renames the method and makes the return type a single Path.

relates #71205

The path.data setting is now a singular string, but the method
dataFiles() that gives access to the path is still an array. This commit
renames the method and makes the return type a single Path.

relates elastic#71205
@rjernst rjernst added :Core/Infra/Core Core issues without another label >refactoring v8.0.0 labels Apr 27, 2021
@rjernst rjernst requested a review from jasontedor April 27, 2021 19:01
@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)

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.

nodePaths = new NodePath[environment.dataFiles().length];
locks = new Lock[nodePaths.length];
nodePaths = new NodePath[1];
locks = new Lock[1];
Copy link
Member

Choose a reason for hiding this comment

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

I am assuming these are follow ups.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed.

@@ -566,7 +566,8 @@ public void testResolvePath() throws Exception {
for (String nodeName : nodeNames) {
final Path indexPath = indexPathByNodeName.get(nodeName);
final OptionSet options = parser.parse("--dir", indexPath.toAbsolutePath().toString());
command.findAndProcessShardPath(options, environmentByNodeName.get(nodeName), environmentByNodeName.get(nodeName).dataFiles(),
command.findAndProcessShardPath(options, environmentByNodeName.get(nodeName),
new Path[] { environmentByNodeName.get(nodeName).dataFile() },
Copy link
Member

Choose a reason for hiding this comment

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

Is there potential for a follow up here to make this method parameter be single-valued?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I'm working through essentially anything in the entire codebase that uses Path[].

@rjernst rjernst merged commit b1eab79 into elastic:master Apr 28, 2021
@rjernst rjernst deleted the mdp12 branch April 28, 2021 02:48
@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
This reverts commit b1eab79.

This revert was conflict free.

relates elastic#78525
relates elastic#71205
rjernst added a commit that referenced this pull request Oct 13, 2021
This reverts commit b1eab79.

This revert was conflict free.

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.

4 participants