aryangupta1998 commented on code in PR #8423:
URL: https://github.com/apache/ozone/pull/8423#discussion_r2085571465


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdb/util/RdbUtil.java:
##########
@@ -49,4 +54,16 @@ public static Set<String> getSSTFilesForComparison(
         .map(lfm -> new File(lfm.path(), lfm.fileName()).getPath())
         .collect(Collectors.toCollection(HashSet::new));
   }
+
+  public static Map<Object, String> getSSTFilesWithInodesForComparison(final 
ManagedRocksDB rocksDB, List<String> cfs)
+      throws IOException {
+    List<LiveFileMetaData> liveSSTFilesForCFs = getLiveSSTFilesForCFs(rocksDB, 
cfs);
+    Map<Object, String> inodeToSstMap = new HashMap<>();
+    for (LiveFileMetaData lfm : liveSSTFilesForCFs) {
+      File sstFile = new File(lfm.path(), lfm.fileName());
+      Object inode = Files.readAttributes(sstFile.toPath(), 
BasicFileAttributes.class).fileKey();

Review Comment:
   IIUC, there's a small possibility—especially with a large number of 
snapshots—that some of them might share the same SST files. To optimize this, 
we could consider maintaining a Set of SST file paths and skipping repeated 
Files.readAttributes calls for files we've already processed.



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to