kerneltime commented on PR #6022: URL: https://github.com/apache/ozone/pull/6022#issuecomment-1899416522
> @kerneltime can you explain the difference in the two options? Looking at the code it seems both options end up calling `RDBStoreAbstractIterator#seek0` soon after the iterator is created. Based on the [RocksDB API](https://github.com/facebook/rocksdb/wiki/Prefix-Seek#transition-to-the-new-usage) it does not look like the underlying implementation does anything different in these two cases. When the constructor is called without prefix ``` RDBStoreByteArrayIterator(ManagedRocksIterator iterator, RDBTable table, byte[] prefix) { super(iterator, table, prefix == null ? null : Arrays.copyOf(prefix, prefix.length)); seekToFirst(); } ``` seekToFirst() does ``` public final void seekToFirst() { if (prefix == null) { rocksDBIterator.get().seekToFirst(); } else { seek0(prefix); } setCurrentEntry(); } ``` which in turn calls ``` @Override public void seekToFirst() { assert (isOwningHandle()); seekToFirst0(nativeHandle_); } ``` -- 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]
