armstrong0704 opened a new pull request, #9542: URL: https://github.com/apache/ozone/pull/9542
## What changes were proposed in this pull request? Fixes HDDS-8655 - Improve listKey performance for OBS buckets ## Description This change optimizes the listKeys operation in Ozone Manager by removing a redundant seek operation during iterator initialization. Previously, the listKeys functionality would create an iterator which implicitly sought to the beginning of the table (seekToFirst), and then immediately sought to the specific start key. This caused a double-seek, which is inefficient for RocksDB, particularly when the initial seek triggers unnecessary block loads. ## Changes - **Framework:** Extended the Table interface to support passing a seek key directly when creating an iterator. - **Implementation:** Updated RDBTable and TypedTable to handle this new parameter. - **RocksDB:** Modified RDBStoreByteArrayIterator to check for a seek key in its constructor. If one is provided, it seeks directly to that position, skipping the default behavior of seeking to the first key. - **Ozone Manager:** Updated the listKeys implementation to use this new iterator approach. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-8655 ## How was this patch tested? I added a new regression test, testIteratorWithSeek, to TestRDBStore to confirm that the iterator starts correctly at the designated key. I also verified thread safety with a new concurrency test, testConcurrentIteratorWithWrites, which runs a writer and a reader in parallel to ensure stability. Existing tests in TestOmMetadataManager also pass. -- 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]
