aryangupta1998 commented on code in PR #8423: URL: https://github.com/apache/ozone/pull/8423#discussion_r2085581487
########## hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java: ########## @@ -1217,6 +1222,28 @@ Set<String> getDeltaFiles(OmSnapshot fromSnapshot, toSnapshot.getSnapshotTableKey())); } + private Set<String> getDiffFiles(OmSnapshot fromSnapshot, OmSnapshot toSnapshot, List<String> tablesToLookUp) { + Set<String> diffFiles; + try { + Map<Object, String> fromSnapshotFiles = getSSTFileMapForSnapshot(fromSnapshot, tablesToLookUp); + Map<Object, String> toSnapshotFiles = getSSTFileMapForSnapshot(toSnapshot, tablesToLookUp); + diffFiles = Stream.concat( + fromSnapshotFiles.entrySet().stream() + .filter(e -> !toSnapshotFiles.containsKey(e.getKey())), + toSnapshotFiles.entrySet().stream() + .filter(e -> !fromSnapshotFiles.containsKey(e.getKey()))) + .map(Map.Entry::getValue) + .collect(Collectors.toSet()); + } catch (IOException e) { + // In case of exception during inode read use all files + LOG.error("Exception occurred while populating delta files for snapDiff", e); + diffFiles = new HashSet<>(); + diffFiles.addAll(getSSTFileListForSnapshot(fromSnapshot, tablesToLookUp)); + diffFiles.addAll(getSSTFileListForSnapshot(toSnapshot, tablesToLookUp)); Review Comment: Let's add a warn message, maybe something like, `LOG.warn("Falling back to full file list comparison, inode-based optimization skipped.");` -- 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