You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/07/09 16:48:00 UTC

[jira] [Updated] (HDDS-3983) Ozone RocksDB Iterator wrapper should not expose key() and value() API.

     [ https://issues.apache.org/jira/browse/HDDS-3983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated HDDS-3983:
---------------------------------
    Labels: pull-request-available  (was: )

> Ozone RocksDB Iterator wrapper should not expose key() and value() API.
> -----------------------------------------------------------------------
>
>                 Key: HDDS-3983
>                 URL: https://issues.apache.org/jira/browse/HDDS-3983
>             Project: Apache Ozone
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Aravindan Vijayan
>            Assignee: Zita Dombi
>            Priority: Major
>              Labels: pull-request-available
>
> While investigating HDDS-3965 with [~nanda619], it was found that there is discrepancy in the implementation of the next(), key() and value() methods in the RDBStoreIterator wrapper class. 
> *next()* returns the current rocksdb entry and moves ahead to the next entry. 
> *key()* returns current rocksdb entry's key.
> *value()* returns current rocksdb entry's value.
> This means that during iteration next() returns the current value, and subsequent calls to key() / value() after next() will return the next value. To solve this, we can remove those 2 APIs from the iterator class, and have the usages follow this pattern.
> {code}
> Iterator iter = rdbTable.iterator();
> while (iter.haxNext()) {
>    Entry<Key,Value> entry = iter.next();
>    // Use only entry.getKey(), entry.getValue().
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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