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


##########
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:
   So the idea is that we can wrap any Iterator and make it Closeable.
   Where do you suggest this should be placed?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to