From 08448a5575aad3b005dc71e5eb9622e15b9ed3f4 Mon Sep 17 00:00:00 2001 From: Ashish Singh Date: Fri, 22 Mar 2024 21:59:16 +0530 Subject: [PATCH] Fix gradle failures Signed-off-by: Ashish Singh --- .../opensearch/index/remote/RemoteStoreDataEnums.java | 6 ++++++ .../index/remote/RemoteStorePathTypeTests.java | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/remote/RemoteStoreDataEnums.java b/server/src/main/java/org/opensearch/index/remote/RemoteStoreDataEnums.java index 597b8e1a75f01..1afd73bf1f1b3 100644 --- a/server/src/main/java/org/opensearch/index/remote/RemoteStoreDataEnums.java +++ b/server/src/main/java/org/opensearch/index/remote/RemoteStoreDataEnums.java @@ -20,6 +20,9 @@ */ 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)); @@ -41,6 +44,9 @@ public String getName() { } } + /** + * Types of data in remote store. + */ public enum DataType { DATA("data"), METADATA("metadata"), diff --git a/server/src/test/java/org/opensearch/index/remote/RemoteStorePathTypeTests.java b/server/src/test/java/org/opensearch/index/remote/RemoteStorePathTypeTests.java index 296dea66f5a0b..0f108d1b45f5a 100644 --- a/server/src/test/java/org/opensearch/index/remote/RemoteStorePathTypeTests.java +++ b/server/src/test/java/org/opensearch/index/remote/RemoteStorePathTypeTests.java @@ -64,12 +64,12 @@ public void testGeneratePathForFixedType() { String basePath = getPath(pathList) + indexUUID + SEPARATOR + shardId + SEPARATOR; // Translog Data BlobPath result = FIXED.path(blobPath, indexUUID, shardId, dataCategory, dataType); - assertEquals(basePath + dataCategory + SEPARATOR + dataType + SEPARATOR, result.buildAsString()); + assertEquals(basePath + dataCategory.getName() + SEPARATOR + dataType.getName() + SEPARATOR, result.buildAsString()); // Translog Metadata dataType = METADATA; result = FIXED.path(blobPath, indexUUID, shardId, dataCategory, dataType); - assertEquals(basePath + dataCategory + SEPARATOR + dataType + SEPARATOR, result.buildAsString()); + assertEquals(basePath + dataCategory.getName() + SEPARATOR + dataType.getName() + SEPARATOR, result.buildAsString()); // Translog Lock files - This is a negative case where the assertion will trip. BlobPath finalBlobPath = blobPath; @@ -79,17 +79,17 @@ public void testGeneratePathForFixedType() { dataCategory = SEGMENTS; dataType = DATA; result = FIXED.path(blobPath, indexUUID, shardId, dataCategory, dataType); - assertEquals(basePath + dataCategory + SEPARATOR + dataType + SEPARATOR, result.buildAsString()); + assertEquals(basePath + dataCategory.getName() + SEPARATOR + dataType.getName() + SEPARATOR, result.buildAsString()); // Segment Metadata dataType = METADATA; result = FIXED.path(blobPath, indexUUID, shardId, dataCategory, dataType); - assertEquals(basePath + dataCategory + SEPARATOR + dataType + SEPARATOR, result.buildAsString()); + assertEquals(basePath + dataCategory.getName() + SEPARATOR + dataType.getName() + SEPARATOR, result.buildAsString()); // Segment Metadata dataType = LOCK_FILES; result = FIXED.path(blobPath, indexUUID, shardId, dataCategory, dataType); - assertEquals(basePath + dataCategory + SEPARATOR + dataType + SEPARATOR, result.buildAsString()); + assertEquals(basePath + dataCategory.getName() + SEPARATOR + dataType.getName() + SEPARATOR, result.buildAsString()); } private List getPathList() {