-
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.
[Backport 2.x] Refactor remote store flow to support any path type #1…
…2822 #12920 (#13405) * Refactor remote store flow to support any path type (#12822) Signed-off-by: Ashish Singh <[email protected]> * Add missed API visibility annotations for public APIs (#12920) Signed-off-by: Ashish Singh <[email protected]> --------- Signed-off-by: Ashish Singh <[email protected]>
- Loading branch information
Showing
21 changed files
with
427 additions
and
111 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
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
69 changes: 69 additions & 0 deletions
69
server/src/main/java/org/opensearch/index/remote/RemoteStoreDataEnums.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,69 @@ | ||
/* | ||
* 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.annotation.PublicApi; | ||
|
||
import java.util.Set; | ||
|
||
import static org.opensearch.index.remote.RemoteStoreDataEnums.DataType.DATA; | ||
import static org.opensearch.index.remote.RemoteStoreDataEnums.DataType.METADATA; | ||
|
||
/** | ||
* This class contains the different enums related to remote store data categories and types. | ||
* | ||
* @opensearch.api | ||
*/ | ||
public class RemoteStoreDataEnums { | ||
|
||
/** | ||
* Categories of the data in Remote store. | ||
*/ | ||
@PublicApi(since = "2.14.0") | ||
public enum DataCategory { | ||
SEGMENTS("segments", Set.of(DataType.values())), | ||
TRANSLOG("translog", Set.of(DATA, METADATA)); | ||
|
||
private final String name; | ||
private final Set<DataType> supportedDataTypes; | ||
|
||
DataCategory(String name, Set<DataType> supportedDataTypes) { | ||
this.name = name; | ||
this.supportedDataTypes = supportedDataTypes; | ||
} | ||
|
||
public boolean isSupportedDataType(DataType dataType) { | ||
return supportedDataTypes.contains(dataType); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} | ||
|
||
/** | ||
* Types of data in remote store. | ||
*/ | ||
@PublicApi(since = "2.14.0") | ||
public enum DataType { | ||
DATA("data"), | ||
METADATA("metadata"), | ||
LOCK_FILES("lock_files"); | ||
|
||
private final String name; | ||
|
||
DataType(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.