SaketaChalamchala opened a new pull request, #10484: URL: https://github.com/apache/ozone/pull/10484
## What changes were proposed in this pull request? Developed with the help of Cursor AI. This PR adds a k-way merge iterator over native RocksDB SST reader/iterator in `hadoop-hdds/rocks-native` module that emits the latest value and/or the latest tombstone per key. This PR intended as the foundation for a more efficient snapshot diff ([HDDS-9154](https://issues.apache.org/jira/browse/HDDS-9154)) where the diff can be calculated directly from the delta set of SST files instead of doing a random lookup from the target snapshot. - `VersionedKWayMergeIterator` performs a dual-heap k-way merge over multiple SST file iterators: - A value heap for non-tombstone entries - A tombstone heap for delete/tombstone entries - For each user key, the iterator drains all versions from both heaps, tracks the highest-sequence value and tombstone, then delegates emission to a pluggable `VersionedMergeEmitter`. Heap ordering and user-key grouping are controlled by `VersionedMergeComparators`. - Deferred value copying: raw SST heap heads hold CodecBuffer references and copy on emit. - `LatestVersionMergeComparators` implements `VersionedMergeComparators` — user key ascending, sequence descending (newest rocksDB entry first) - `LatestVersionMergeEmitter` implements `VersionedMergeEmitter` — emission rules: - `valueSeq > tombstoneSeq` → emit both (delete→recreate) - `tombstoneSeq >= valueSeq` → emit tombstone only - value-only or tombstone-only otherwise ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-15388 ## How was this patch tested? Unit Tests. -- 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]
