ayushtkn commented on a change in pull request #2516:
URL: https://github.com/apache/hive/pull/2516#discussion_r705078639



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/util/Retryable.java
##########
@@ -166,6 +169,25 @@ public synchronized Builder withRetryOnExceptionList(final 
List<Class<? extends
       return this;
     }
 
+    public synchronized Builder withFailOnParentException(final Class<? 
extends Exception> exceptionClass) {
+      if (exceptionClass != null &&
+              runnable.failOnParentExceptions.stream().noneMatch(k -> 
exceptionClass.equals(k))) {
+        runnable.failOnParentExceptions.add(exceptionClass);
+      }
+      return this;
+    }
+
+    public synchronized Builder withFailOnParentExceptionList(final 
List<Class<?
+            extends Exception>> exceptionClassList) {
+      for (final Class<? extends Exception> exceptionClass : 
exceptionClassList) {
+        if (exceptionClass != null &&
+                runnable.failOnParentExceptions.stream().noneMatch(k -> 
exceptionClass.equals(k))) {
+          runnable.failOnParentExceptions.add(exceptionClass);
+        }

Review comment:
       Rather than checking for a unique entry ourselves, can we not use a set 
instead of a list?




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