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

Remove multiple paths from ShardPath #72713

Merged
merged 3 commits into from
May 5, 2021
Merged

Remove multiple paths from ShardPath #72713

merged 3 commits into from
May 5, 2021

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented May 4, 2021

relates #71205

@rjernst rjernst added :Core/Infra/Core Core issues without another label >refactoring v8.0.0 labels May 4, 2021
@rjernst rjernst requested a review from jasontedor May 4, 2021 17:51
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label May 4, 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.

I left a few comments.

@@ -107,51 +107,38 @@ public static ShardPath loadShardPath(Logger logger, NodeEnvironment env,
ShardId shardId, String customDataPath) throws IOException {
final Path shardPath = env.availableShardPath(shardId);
final Path sharedDataPath = env.sharedDataPath();
return loadShardPath(logger, shardId, customDataPath, new Path[] { shardPath }, sharedDataPath);
return loadShardPath(logger, shardId, customDataPath, shardPath, sharedDataPath);
}

/**
* This method walks through the nodes shard paths to find the data and state path for the given shard. If multiple
* directories with a valid shard state exist the one with the highest version will be used.
* <b>Note:</b> this method resolves custom data locations for the shard.
*/
Copy link
Member

Choose a reason for hiding this comment

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

This comment looks out of date now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I tweaked these in 16975ec

}

/**
* This method walks through the nodes shard paths to find the data and state path for the given shard. If multiple
* directories with a valid shard state exist the one with the highest version will be used.
* <b>Note:</b> this method resolves custom data locations for the shard.
*/
public static ShardPath loadShardPath(Logger logger, ShardId shardId, String customDataPath, Path[] availableShardPaths,
public static ShardPath loadShardPath(Logger logger, ShardId shardId, String customDataPath, Path availableShardPath,
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this just shardPath now?

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. Renamed in 16975ec

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.

@rjernst rjernst merged commit 08a89c8 into elastic:master May 5, 2021
@rjernst rjernst deleted the mdp26 branch May 5, 2021 19:47
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 29, 2021
elasticsearchmachine pushed a commit that referenced this pull request Sep 29, 2021
@rjernst rjernst mentioned this pull request Sep 30, 2021
17 tasks
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