gianm commented on a change in pull request #12307:
URL: https://github.com/apache/druid/pull/12307#discussion_r820017814



##########
File path: 
core/src/main/java/org/apache/druid/data/input/impl/RetryingInputStream.java
##########
@@ -19,99 +19,105 @@
 
 package org.apache.druid.data.input.impl;
 
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
 import com.google.common.base.Throwables;
 import com.google.common.io.CountingInputStream;
 import org.apache.druid.data.input.impl.prefetch.Fetcher;
 import org.apache.druid.data.input.impl.prefetch.ObjectOpenFunction;
+import org.apache.druid.java.util.common.IAE;
 import org.apache.druid.java.util.common.RetryUtils;
+import org.apache.druid.java.util.common.StringUtils;
 import org.apache.druid.java.util.common.logger.Logger;
 
 import javax.annotation.Nullable;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.SocketException;
 
 /**
  * This class is used by {@link Fetcher} when prefetch is disabled. It's 
responsible for re-opening the underlying input
- * stream for the input object on the socket connection reset as well as the 
given {@link #retryCondition}.
+ * stream for the input object on the given {@link #retryCondition}.
  *
  * @param <T> object type
  */
 public class RetryingInputStream<T> extends InputStream
 {
-
-  public static final Predicate<Throwable> DEFAULT_RETRY_CONDITION = 
Predicates.alwaysFalse();
-  public static final Predicate<Throwable> DEFAULT_RESET_CONDITION = 
RetryingInputStream::isConnectionReset;
-
   private static final Logger log = new Logger(RetryingInputStream.class);
 
   private final T object;
   private final ObjectOpenFunction<T> objectOpenFunction;
   private final Predicate<Throwable> retryCondition;
-  private final Predicate<Throwable> resetCondition;
-  private final int maxRetry;
+  private final int maxTries;

Review comment:
       To me `maxRetries` seems off by one from what I really care about: the 
total number of attempts. So that's why I went with `maxTries` instead.




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