You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2025/06/21 17:43:16 UTC
[PR] HDDS-13309. Add keyIterator/valueIterator methods to Table. [ozone]
szetszwo opened a new pull request, #8675:
URL: https://github.com/apache/ozone/pull/8675
## What changes were proposed in this pull request?
As suggested by @nandakumar131 , let's add keyIterator/valueIterator methods to Table. It can simplify the code.
## What is the link to the Apache JIRA
HDDS-13309
## How was this patch tested?
By adding new tests.
--
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
Re: [PR] HDDS-13309. Add keyIterator/valueIterator methods to Table. [ozone]
Posted by "nandakumar131 (via GitHub)" <gi...@apache.org>.
nandakumar131 merged PR #8675:
URL: https://github.com/apache/ozone/pull/8675
--
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
Re: [PR] HDDS-13309. Add keyIterator/valueIterator methods to Table. [ozone]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #8675:
URL: https://github.com/apache/ozone/pull/8675#discussion_r2165715641
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TableIterator.java:
##########
@@ -54,4 +56,50 @@ public interface TableIterator<KEY, T> extends Iterator<T>, Closeable {
*/
void removeFromDB() throws RocksDatabaseException, CodecException;
+ /**
+ * Convert the given {@link KeyValueIterator} to a {@link TableIterator} using the given converter.
+ *
+ * @param <K> The key type of both the input and the output iterators
+ * @param <INPUT> The value type of the input iterator
+ * @param <OUTPUT> The value type of the output iterator
+ */
+ static <K, INPUT, OUTPUT> TableIterator<K, OUTPUT> convert(KeyValueIterator<K, INPUT> i,
Review Comment:
No, it can't since the returned iterator needs a close() method for releasing resources.
--
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
Re: [PR] HDDS-13309. Add keyIterator/valueIterator methods to Table. [ozone]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on PR #8675:
URL: https://github.com/apache/ozone/pull/8675#issuecomment-3005589601
@nandakumar131 , thanks a lot for reviewing and merging this!
--
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
Re: [PR] HDDS-13309. Add keyIterator/valueIterator methods to Table. [ozone]
Posted by "nandakumar131 (via GitHub)" <gi...@apache.org>.
nandakumar131 commented on PR #8675:
URL: https://github.com/apache/ozone/pull/8675#issuecomment-3003781492
Thanks @szetszwo for the contribution!
--
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
Re: [PR] HDDS-13309. Add keyIterator/valueIterator methods to Table. [ozone]
Posted by "nandakumar131 (via GitHub)" <gi...@apache.org>.
nandakumar131 commented on code in PR #8675:
URL: https://github.com/apache/ozone/pull/8675#discussion_r2165376804
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TableIterator.java:
##########
@@ -54,4 +56,50 @@ public interface TableIterator<KEY, T> extends Iterator<T>, Closeable {
*/
void removeFromDB() throws RocksDatabaseException, CodecException;
+ /**
+ * Convert the given {@link KeyValueIterator} to a {@link TableIterator} using the given converter.
+ *
+ * @param <K> The key type of both the input and the output iterators
+ * @param <INPUT> The value type of the input iterator
+ * @param <OUTPUT> The value type of the output iterator
+ */
+ static <K, INPUT, OUTPUT> TableIterator<K, OUTPUT> convert(KeyValueIterator<K, INPUT> i,
Review Comment:
It would be nice to have just `Iterator<OUTPUT>` returned by `keyIterator` and `valueIterator` methods.
```suggestion
static <K, INPUT, OUTPUT> Iterator<OUTPUT> convert(KeyValueIterator<K, INPUT> i,
```
--
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