Skip to content

Commit

Permalink
Fix gradle failures
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <[email protected]>
  • Loading branch information
ashking94 committed Mar 22, 2024
1 parent 49941fd commit 08448a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -41,6 +44,9 @@ public String getName() {
}
}

/**
* Types of data in remote store.
*/
public enum DataType {
DATA("data"),
METADATA("metadata"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String> getPathList() {
Expand Down

0 comments on commit 08448a5

Please sign in to comment.