@Override public T call(int operationTimeout) throws IOException { if (isCancelled()) return null; if (Thread.interrupted()) { throw new InterruptedIOException(); } // It is expected (it seems) that tracker.start can be called multiple times (on each trip // through the call when retrying). Also, we can call start and no need of a stop. this.tracker.start(); int remainingTime = tracker.getRemainingTime(operationTimeout); if (remainingTime <= 1) { // "1" is a special return value in RetryingTimeTracker, see its implementation. throw new DoNotRetryIOException("Operation rpcTimeout"); } return super.call(Math.min(rpcTimeout, remainingTime)); }
@Override public T call(int operationTimeout) throws IOException { if (isCancelled()) return null; if (Thread.interrupted()) { throw new InterruptedIOException(); } // It is expected (it seems) that tracker.start can be called multiple times (on each trip // through the call when retrying). Also, we can call start and no need of a stop. this.tracker.start(); int remainingTime = tracker.getRemainingTime(operationTimeout); if (remainingTime <= 1) { // "1" is a special return value in RetryingTimeTracker, see its implementation. throw new DoNotRetryIOException("Operation rpcTimeout"); } return super.call(Math.min(rpcTimeout, remainingTime)); }
@Override public T call(int operationTimeout) throws IOException { if (isCancelled()) return null; if (Thread.interrupted()) { throw new InterruptedIOException(); } // It is expected (it seems) that tracker.start can be called multiple times (on each trip // through the call when retrying). Also, we can call start and no need of a stop. this.tracker.start(); int remainingTime = tracker.getRemainingTime(operationTimeout); if (remainingTime <= 1) { // "1" is a special return value in RetryingTimeTracker, see its implementation. throw new DoNotRetryIOException("Operation rpcTimeout"); } return super.call(Math.min(rpcTimeout, remainingTime)); }