-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Conversation
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
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
nodePaths = new NodePath[environment.dataFiles().length]; | ||
locks = new Lock[nodePaths.length]; | ||
nodePaths = new NodePath[1]; | ||
locks = new Lock[1]; |
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 am assuming these are follow ups.
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.
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() }, |
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.
Is there potential for a follow up here to make this method parameter be single-valued?
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.
Yes. I'm working through essentially anything in the entire codebase that uses Path[].
This reverts commit b1eab79. This revert was conflict free. relates elastic#78525 relates elastic#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 #71205