xushiyan commented on code in PR #7572:
URL: https://github.com/apache/hudi/pull/7572#discussion_r1058438675


##########
hudi-common/src/main/java/org/apache/hudi/common/util/RetryHelper.java:
##########
@@ -36,9 +36,10 @@
  *
  * @param <T> Type of return value for checked function.
  */
-public class RetryHelper<T> implements Serializable {
+public class RetryHelper<T, R extends Exception> implements Serializable {
   private static final Logger LOG = LogManager.getLogger(RetryHelper.class);
-  private transient CheckedFunction<T> func;
+  private static final List<? extends Class<? extends Exception>> 
RETRY_EXCEPTION_CLASS = Arrays.asList(IOException.class, 
RuntimeException.class);

Review Comment:
   better name: `DEFAULT_RETRY_EXCEPTIONS`



##########
hudi-common/src/main/java/org/apache/hudi/common/util/RetryHelper.java:
##########
@@ -120,7 +118,7 @@ private boolean checkIfExceptionInRetryList(Exception e) {
 
     // if users didn't set hoodie.filesystem.operation.retry.exceptions
     // we will retry all the IOException and RuntimeException
-    if (retryExceptionsClasses.isEmpty()) {
+    if (retryExceptionsClasses.equals(RETRY_EXCEPTION_CLASS)) {
       return true;
     }

Review Comment:
   but this check being true does not mean `e` is in the list, does it? this 
check looks redundant now, given you've set a default list of exceptions.



-- 
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-unsubscr...@hudi.apache.org

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

Reply via email to