You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/03/23 08:03:41 UTC

[GitHub] [ozone] guihecheng commented on a change in pull request #3176: HDDS-6428. [Merge rocksdb in datanode] Add prefix iterator support to RDBTable.

guihecheng commented on a change in pull request #3176:
URL: https://github.com/apache/ozone/pull/3176#discussion_r832962856



##########
File path: hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStoreIterator.java
##########
@@ -69,7 +81,9 @@ private void setCurrentEntry() {
 
   @Override
   public boolean hasNext() {
-    return rocksDBIterator.isValid();
+    return rocksDBIterator.isValid() &&
+        (prefix == null || Arrays.equals(
+            Arrays.copyOf(rocksDBIterator.key(), prefix.length), prefix));

Review comment:
       Ah, that's a good idea to prevent copy, thanks~




-- 
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-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org