This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new eec521d38d HDDS-7509. Use UUID for snapshotId instead of String - 
addendum: fix compile error
eec521d38d is described below

commit eec521d38df7a916e581a7afda0b0f8d339348a0
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sat Jun 10 11:53:48 2023 +0200

    HDDS-7509. Use UUID for snapshotId instead of String - addendum: fix 
compile error
---
 .../ozone/om/snapshot/TestSnapshotDiffManager.java    | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
index 2033a81887..bbca98081e 100644
--- 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
+++ 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
@@ -84,6 +84,7 @@ import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -181,9 +182,9 @@ public class TestSnapshotDiffManager {
     return snapshotDiffManager;
   }
 
-  private SnapshotInfo getMockedSnapshotInfo(String snapshot) {
+  private SnapshotInfo getMockedSnapshotInfo(UUID snapshotId) {
     SnapshotInfo snapshotInfo = Mockito.mock(SnapshotInfo.class);
-    Mockito.when(snapshotInfo.getSnapshotID()).thenReturn(snapshot);
+    Mockito.when(snapshotInfo.getSnapshotId()).thenReturn(snapshotId);
     return snapshotInfo;
   }
 
@@ -193,8 +194,8 @@ public class TestSnapshotDiffManager {
       throws ExecutionException, RocksDBException, IOException {
 
     SnapshotDiffManager snapshotDiffManager = getMockedSnapshotDiffManager(10);
-    String snap1 = "snap1";
-    String snap2 = "snap2";
+    UUID snap1 = UUID.randomUUID();
+    UUID snap2 = UUID.randomUUID();
 
     String diffDir = Files.createTempDirectory("snapdiff_dir").toString();
     Set<String> randomStrings = IntStream.range(0, numberOfFiles)
@@ -207,7 +208,8 @@ public class TestSnapshotDiffManager {
     SnapshotInfo toSnapshotInfo = getMockedSnapshotInfo(snap1);
     Mockito.when(jobTableIterator.isValid()).thenReturn(false);
     Set<String> deltaFiles = snapshotDiffManager.getDeltaFiles(
-        snapshotCache.get(snap1), snapshotCache.get(snap2),
+        snapshotCache.get(snap1.toString()),
+        snapshotCache.get(snap2.toString()),
         Arrays.asList("cf1", "cf2"), fromSnapshotInfo, toSnapshotInfo, false,
         Collections.EMPTY_MAP, diffDir);
     Assertions.assertEquals(randomStrings, deltaFiles);
@@ -248,8 +250,8 @@ public class TestSnapshotDiffManager {
           });
       SnapshotDiffManager snapshotDiffManager =
           getMockedSnapshotDiffManager(10);
-      String snap1 = "snap1";
-      String snap2 = "snap2";
+      UUID snap1 = UUID.randomUUID();
+      UUID snap2 = UUID.randomUUID();
       if (!useFullDiff) {
         Set<String> randomStrings = Collections.emptySet();
         Mockito.when(differ.getSSTDiffListWithFullPath(
@@ -262,7 +264,8 @@ public class TestSnapshotDiffManager {
       SnapshotInfo toSnapshotInfo = getMockedSnapshotInfo(snap1);
       Mockito.when(jobTableIterator.isValid()).thenReturn(false);
       Set<String> deltaFiles = snapshotDiffManager.getDeltaFiles(
-          snapshotCache.get(snap1), snapshotCache.get(snap2),
+          snapshotCache.get(snap1.toString()),
+          snapshotCache.get(snap2.toString()),
           Arrays.asList("cf1", "cf2"), fromSnapshotInfo, toSnapshotInfo, false,
           Collections.EMPTY_MAP, Files.createTempDirectory("snapdiff_dir")
               .toAbsolutePath().toString());


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to