Skip to content

Commit 2206fa4

Browse files
himshikhaBukhtawaralchemist51
authored and
Himshikha Gupta
committed
[Remote Routing Table] Add write flow for remote routing table (opensearch-project#13870)
* Introduce RemoteRoutingTableService for shard routing table management Signed-off-by: Himshikha Gupta <himshikh@amazon.com> Co-authored-by: Bukhtawar Khan <bukhtawa@amazon.com> Co-authored-by: Arpit Bandejiya <abandeji@amazon.com>
1 parent a9d2050 commit 2206fa4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

server/src/main/java/org/opensearch/gateway/remote/RemoteClusterStateService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ public class RemoteClusterStateService implements Closeable {
172172
/**
173173
* Manifest format compatible with codec v2, where global metadata file is replaced with multiple metadata attribute files
174174
*/
175+
public static final ChecksumBlobStoreFormat<ClusterMetadataManifest> CLUSTER_METADATA_MANIFEST_FORMAT_V2 =
176+
new ChecksumBlobStoreFormat<>("cluster-metadata-manifest", METADATA_MANIFEST_NAME_FORMAT, ClusterMetadataManifest::fromXContentV2);
177+
178+
/**
179+
* Manifest format compatible with codec v3, where global metadata file is replaced with multiple metadata attribute files
180+
*/
175181
public static final ChecksumBlobStoreFormat<ClusterMetadataManifest> CLUSTER_METADATA_MANIFEST_FORMAT = new ChecksumBlobStoreFormat<>(
176182
"cluster-metadata-manifest",
177183
METADATA_MANIFEST_NAME_FORMAT,
@@ -1533,6 +1539,8 @@ private ChecksumBlobStoreFormat<ClusterMetadataManifest> getClusterMetadataManif
15331539
long codecVersion = getManifestCodecVersion(fileName);
15341540
if (codecVersion == MANIFEST_CURRENT_CODEC_VERSION) {
15351541
return CLUSTER_METADATA_MANIFEST_FORMAT;
1542+
} else if (codecVersion == ClusterMetadataManifest.CODEC_V2) {
1543+
return CLUSTER_METADATA_MANIFEST_FORMAT_V2;
15361544
} else if (codecVersion == ClusterMetadataManifest.CODEC_V1) {
15371545
return CLUSTER_METADATA_MANIFEST_FORMAT_V1;
15381546
} else if (codecVersion == ClusterMetadataManifest.CODEC_V0) {

server/src/test/java/org/opensearch/gateway/remote/ClusterMetadataManifestTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ public void testClusterMetadataManifestXContentV2WithoutEphemeral() throws IOExc
539539
"routing-path",
540540
InternalRemoteRoutingTableService.INDEX_ROUTING_METADATA_PREFIX
541541
);
542+
542543
ClusterMetadataManifest originalManifest = ClusterMetadataManifest.builder()
543544
.clusterTerm(1L)
544545
.stateVersion(1L)

0 commit comments

Comments
 (0)