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


##########
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:
   The method reads the SST files from a single snapshot here i.e a single 
rocksdb instance .
   
   > especially with a large number of snapshots—that some of them might share 
the same SST files.
   
   We have to anyway list all the SST files as part of full snapshot diff 
calculation, readAttributes reads the file metadata in linux which is usually a 
cheap call so that should be okay.



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