You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/01/26 04:37:38 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #7752: [MINOR] De-duplicating Iterator implementations

danny0405 commented on code in PR #7752:
URL: https://github.com/apache/hudi/pull/7752#discussion_r1087434255


##########
hudi-common/src/main/java/org/apache/hudi/common/util/ClosableIterator.java:
##########
@@ -24,8 +24,29 @@
  * An iterator that give a chance to release resources.
  *
  * @param <R> The return type
+ *
+ * TODO move under common.util.collection
  */
 public interface ClosableIterator<R> extends Iterator<R>, AutoCloseable {
   @Override
   void close(); // override to not throw exception
+
+  static <E> ClosableIterator<E> wrap(Iterator<E> iterator) {
+    return new ClosableIterator<E>() {
+      @Override
+      public boolean hasNext() {

Review Comment:
   Does the wrap make any sense here?



-- 
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: commits-unsubscribe@hudi.apache.org

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