[
https://issues.apache.org/jira/browse/HDDS-3983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zita Dombi updated HDDS-3983:
-----------------------------
Fix Version/s: 1.3.0
> 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
> Fix For: 1.3.0
>
>
> 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.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]