-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Introduce remote store path type in customData in IndexMetadata #12607
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
Merged
+201
−9
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d256b66
Introduce remote store path type in customData in IndexMetadata
ashking94 8ab4d9e
Incorporate PR review comments
ashking94 683697c
Merge remote-tracking branch 'upstream/main' into remote-path-type
ashking94 25e06e9
Incorporate PR review comments
ashking94 fab0366
Merge remote-tracking branch 'upstream/main' into remote-path-type
ashking94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
30 changes: 30 additions & 0 deletions
30
server/src/main/java/org/opensearch/index/remote/RemoteStorePathResolver.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| package org.opensearch.index.remote; | ||
|
|
||
| import org.opensearch.common.settings.ClusterSettings; | ||
| import org.opensearch.indices.IndicesService; | ||
|
|
||
| /** | ||
| * Determines the {@link RemoteStorePathType} at the time of index metadata creation. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public class RemoteStorePathResolver { | ||
|
|
||
| private final ClusterSettings clusterSettings; | ||
|
|
||
| public RemoteStorePathResolver(ClusterSettings clusterSettings) { | ||
| this.clusterSettings = clusterSettings; | ||
| } | ||
|
|
||
| public RemoteStorePathType resolveType() { | ||
| return clusterSettings.get(IndicesService.CLUSTER_REMOTE_STORE_PATH_PREFIX_TYPE_SETTING); | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
server/src/main/java/org/opensearch/index/remote/RemoteStorePathType.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
|
|
||
| package org.opensearch.index.remote; | ||
|
|
||
| import java.util.Locale; | ||
|
|
||
| /** | ||
| * Enumerates the types of remote store paths resolution techniques supported by OpenSearch. | ||
| * For more information, see <a href="https://github.com/opensearch-project/OpenSearch/issues/12567">Github issue #12567</a>. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public enum RemoteStorePathType { | ||
|
|
||
| FIXED, | ||
| HASHED_PREFIX; | ||
|
|
||
| public static RemoteStorePathType parseString(String remoteStoreBlobPathType) { | ||
| try { | ||
| return RemoteStorePathType.valueOf(remoteStoreBlobPathType.toUpperCase(Locale.ROOT)); | ||
| } catch (IllegalArgumentException e) { | ||
| throw new IllegalArgumentException("Could not parse RemoteStorePathType for [" + remoteStoreBlobPathType + "]"); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * This string is used as key for storing information in the custom data in index settings. | ||
| */ | ||
| public static final String NAME = "path_type"; | ||
| } |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.