-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor remote store flow to support any path type (#12822)
Signed-off-by: Ashish Singh <ssashish@amazon.com>
- Loading branch information
Showing
20 changed files
with
418 additions
and
110 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
65 changes: 65 additions & 0 deletions
65
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,65 @@ | ||
/* | ||
* 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.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.internal | ||
*/ | ||
public class RemoteStoreDataEnums { | ||
|
||
/** | ||
* Categories of the data in Remote store. | ||
*/ | ||
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. | ||
*/ | ||
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.