diff options
author | 2017-12-04 10:44:47 -0800 | |
---|---|---|
committer | 2017-12-04 10:46:55 -0800 | |
commit | 44e40bc84d05eea7a3527fed12028ef58e90d607 (patch) | |
tree | c1748ccacc615c0a101bad3d098e21cd9acc5cbd /src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java | |
parent | a3cdbba16ba1424ad84904823b7d64f8aedcffd1 (diff) |
remote: Replace Retrier with Retrier2.
- Replace the existing Retrier with Retrier2.
- Rename Retrier2 to Retrier and remove the old Retrier + RetryException
class.
RELNOTES: None.
PiperOrigin-RevId: 177835070
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java index 8359f4de99..27de8b7305 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java @@ -36,13 +36,13 @@ import java.util.function.Supplier; * // Not retried. * throw PassThroughException(new IOException("fail")); * } - * } catch (RetryException2 e) { + * } catch (RetryException e) { * // e.getCause() is the IOException * System.out.println(e.getCause()); * } * </code> */ -class RemoteRetrier extends Retrier2 { +class RemoteRetrier extends Retrier { /** * Wraps around an {@link Exception} to make it pass through a single layer of retries. @@ -96,13 +96,13 @@ class RemoteRetrier extends Retrier2 { } @Override - public <T> T execute(Callable<T> call) throws RetryException2, InterruptedException { + public <T> T execute(Callable<T> call) throws RetryException, InterruptedException { try { return super.execute(call); - } catch (RetryException2 e) { + } catch (RetryException e) { if (e.getCause() instanceof PassThroughException) { PassThroughException passThrough = (PassThroughException) e.getCause(); - throw new RetryException2("Retries aborted because of PassThroughException", + throw new RetryException("Retries aborted because of PassThroughException", e.getAttempts(), (Exception) passThrough.getCause()); } throw e; @@ -116,7 +116,7 @@ class RemoteRetrier extends Retrier2 { return e -> !(e instanceof PassThroughException) && delegate.test(e); } - static class ExponentialBackoff implements Retrier2.Backoff { + static class ExponentialBackoff implements Retrier.Backoff { private final long maxMillis; private long nextDelayMillis; |