swamirishi commented on code in PR #5155:
URL: https://github.com/apache/ozone/pull/5155#discussion_r1287791205
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotUtils.java:
##########
@@ -78,4 +84,41 @@ public void testLinkFiles(@TempDir File tempDir) throws
Exception {
assertEquals(tree1Files, tree2Files);
GenericTestUtils.deleteDirectory(tempDir);
}
+
+
+ private static Stream<Arguments> testCasesForIgnoreSnapshotGc() {
+ SnapshotInfo filteredSnapshot =
+
SnapshotInfo.newBuilder().setSstFiltered(true).setName("snap1").build();
+ SnapshotInfo unFilteredSnapshot =
+ SnapshotInfo.newBuilder().setSstFiltered(false).setName("snap1")
+ .build();
+ // {IsSnapshotFiltered,isSnapshotDeleted,IsSstServiceEnabled =
ShouldIgnore}
+ return Stream.of(Arguments.of(filteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED, true, false),
+ Arguments.of(filteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE, true, true),
+ Arguments.of(unFilteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED, true, true),
+ Arguments.of(unFilteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE, true, true),
+ Arguments.of(filteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED, false, false),
+ Arguments.of(unFilteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED, false, false),
+ Arguments.of(unFilteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE, false, true),
+ Arguments.of(filteredSnapshot,
+ SnapshotInfo.SnapshotStatus.SNAPSHOT_ACTIVE, false, true));
+ }
+
+ @ParameterizedTest
+ @MethodSource("testCasesForIgnoreSnapshotGc")
+ public void testProcessSnapshotLogicInSDS(SnapshotInfo snapshotInfo,
+ SnapshotInfo.SnapshotStatus status, boolean isSstFilteringSvcEnabled,
+ boolean expectedOutcome) {
+ assertEquals(expectedOutcome,
Review Comment:
```suggestion
snapshotInfo.setSnapshotStatus(status);
assertEquals(expectedOutcome,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]