jojochuang commented on code in PR #9268:
URL: https://github.com/apache/ozone/pull/9268#discussion_r2535669836


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -832,22 +779,29 @@ private String getSSTFullPath(String 
sstFilenameWithoutExtension,
    *               "/path/to/sstBackupDir/000060.sst"]
    */
   public synchronized Optional<List<String>> 
getSSTDiffListWithFullPath(DifferSnapshotInfo src,
-      DifferSnapshotInfo dest, Set<String> tablesToLookup,
-      String sstFilesDirForSnapDiffJob) {
+      DifferSnapshotInfo dest, Map<Integer, Integer> versionMap, 
TablePrefixInfo prefixInfo,
+      Set<String> tablesToLookup, String sstFilesDirForSnapDiffJob) throws 
IOException {
+    int srcVersion = src.getMaxVersion();
+    if (!versionMap.containsKey(srcVersion)) {
+      throw new IOException("No corresponding dest version corresponding 
srcVersion : " + srcVersion + " in " +
+          "versionMap : " + versionMap);
+    }
+    int destVersion = versionMap.get(srcVersion);
+    DifferSnapshotVersion srcSnapshotVersion = new DifferSnapshotVersion(src, 
src.getMaxVersion(), tablesToLookup);
+    DifferSnapshotVersion destSnapshotVersion = new 
DifferSnapshotVersion(dest, destVersion, tablesToLookup);
 
-    Optional<List<String>> sstDiffList = getSSTDiffList(src, dest, 
tablesToLookup);
+    Optional<List<SstFileInfo>> sstDiffList = 
getSSTDiffList(srcSnapshotVersion, destSnapshotVersion, prefixInfo,
+        tablesToLookup, srcVersion == 0);

Review Comment:
   ```suggestion
       // if  the source snapshot is the first version (srcVersion == 0), uses 
the compaction DAG path;
       // otherwise, uses the fallback set-comparison path.
       boolean useCompactionDag = srcVersion == 0;
       Optional<List<SstFileInfo>> sstDiffList = 
getSSTDiffList(srcSnapshotVersion, destSnapshotVersion, prefixInfo,
           tablesToLookup, useCompactionDag);
   ```



##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -832,22 +779,29 @@ private String getSSTFullPath(String 
sstFilenameWithoutExtension,
    *               "/path/to/sstBackupDir/000060.sst"]
    */
   public synchronized Optional<List<String>> 
getSSTDiffListWithFullPath(DifferSnapshotInfo src,
-      DifferSnapshotInfo dest, Set<String> tablesToLookup,
-      String sstFilesDirForSnapDiffJob) {
+      DifferSnapshotInfo dest, Map<Integer, Integer> versionMap, 
TablePrefixInfo prefixInfo,
+      Set<String> tablesToLookup, String sstFilesDirForSnapDiffJob) throws 
IOException {
+    int srcVersion = src.getMaxVersion();
+    if (!versionMap.containsKey(srcVersion)) {
+      throw new IOException("No corresponding dest version corresponding 
srcVersion : " + srcVersion + " in " +
+          "versionMap : " + versionMap);
+    }
+    int destVersion = versionMap.get(srcVersion);
+    DifferSnapshotVersion srcSnapshotVersion = new DifferSnapshotVersion(src, 
src.getMaxVersion(), tablesToLookup);
+    DifferSnapshotVersion destSnapshotVersion = new 
DifferSnapshotVersion(dest, destVersion, tablesToLookup);
 
-    Optional<List<String>> sstDiffList = getSSTDiffList(src, dest, 
tablesToLookup);
+    Optional<List<SstFileInfo>> sstDiffList = 
getSSTDiffList(srcSnapshotVersion, destSnapshotVersion, prefixInfo,
+        tablesToLookup, srcVersion == 0);

Review Comment:
   ```suggestion
       // if the source snapshot is the first version (srcVersion == 0), uses 
the compaction DAG path;
       // otherwise, uses the fallback set-comparison path.
       boolean useCompactionDag = srcVersion == 0;
       Optional<List<SstFileInfo>> sstDiffList = 
getSSTDiffList(srcSnapshotVersion, destSnapshotVersion, prefixInfo,
           tablesToLookup, useCompactionDag);
   ```



-- 
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]

Reply via email to