hemantk-12 commented on code in PR #4376:
URL: https://github.com/apache/ozone/pull/4376#discussion_r1160292498


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/util/ClosableIterator.java:
##########
@@ -17,12 +17,11 @@
  */
 package org.apache.hadoop.util;
 
+import java.io.Closeable;
 import java.util.Iterator;
 
 /**
  * An {@link Iterator} that may hold resources until it is closed.
  */
-public interface ClosableIterator<E> extends Iterator<E>, AutoCloseable {
-  @Override
-  void close();
+public interface ClosableIterator<E> extends Iterator<E>, Closeable {

Review Comment:
   1. If a client can reasonably be expected to recover from an exception, make 
it a checked exception. If a client cannot do anything to recover from the 
exception, make it an unchecked exception from [Oracle documentation]( 
https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html). I 
don't think client can do anything in this scenario.
   2. `It is better to avoid runtime exceptions as much as possible.` is not 
true. If you look for exception in any other new language like Kotlin, they 
don't even have checked exception. Or any other cloud API like AWS.
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to