swamirishi opened a new pull request, #9559: URL: https://github.com/apache/ozone/pull/9559
## What changes were proposed in this pull request? Currently for prefix based iteration, the comparison happens on Java side which is inefficient firstly because this incurs an additional buffer copy cost in each and every call of hasNext on iteration i.e. in case of RDBStoreCodecBufferIterator it is going to be a copy b/w 2 direct byte buffer and in case of RDBStoreByteArrayIterator it is going to be a direct to heap byte array allocation which is expensive. Moreover the prefix check is also inefficient on java side and this would be very efficient on c++ since rocksdb internally does a memcmp. The patch aims to set lowerBound and upperBound in readOptions on rocksItr initialize. Here the lowerBound is going to be the prefix itself and upperBound is going to be nextHigherByteArray entry. If the prefix is going to have all bytes start with 0xFF or if it is empty then there can be no upper bound for the iterator and lower bound is going to be just and the iteration has to happen beginning from the prefix and iterate till the end of the table. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-14242 ## How was this patch tested? Added unit tests and also depending on pre existing rocksdb test cases in class TestRDBTableStore -- 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]
