-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce remote store path type in customData in IndexMetadata
Signed-off-by: Ashish Singh <ssashish@amazon.com>
- Loading branch information
Showing
5 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 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
37 changes: 37 additions & 0 deletions
37
server/src/main/java/org/opensearch/index/remote/RemoteStorePathType.java
This file contains 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,37 @@ | ||
/* | ||
* 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; | ||
|
||
/** | ||
* 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 remoteStorePathType) { | ||
try { | ||
return RemoteStorePathType.valueOf(remoteStorePathType); | ||
} catch (IllegalArgumentException e) { | ||
throw new IllegalArgumentException("Could not parse RemoteStorePathType for [" + remoteStorePathType + "]"); | ||
} catch (NullPointerException npe) { | ||
// return a default value for null input | ||
return FIXED; | ||
} | ||
} | ||
|
||
/** | ||
* 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 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