smengcl commented on code in PR #8912:
URL: https://github.com/apache/ozone/pull/8912#discussion_r2331508488


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdb/util/SstFileSetReader.java:
##########
@@ -233,70 +236,149 @@ public String next() {
     }
   }
 
-  private abstract static class MultipleSstFileIterator<T> implements 
ClosableIterator<T> {
+  /**
+   * A wrapper class that holds an iterator and its current value for heap 
operations.
+   */
+  private static class HeapEntryWithFileIdx<T extends Comparable<T>>
+      implements Comparable<HeapEntryWithFileIdx<T>> {
+    private final ClosableIterator<T> iterator;
+    private T currentKey;
+    // To ensure stable ordering for identical keys
+    private final int fileIndex;

Review Comment:
   Purpose of fileIndex is to keep track of which sst file has higher index 
when multiple entries exist. When there are duplicates, values in SST files 
with higher index should be in the result.



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