From 44e40bc84d05eea7a3527fed12028ef58e90d607 Mon Sep 17 00:00:00 2001 From: buchgr Date: Mon, 4 Dec 2017 10:44:47 -0800 Subject: 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 --- .../com/google/devtools/build/lib/remote/RemoteRetrier.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteRetrier.java') 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()); * } * */ -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 execute(Callable call) throws RetryException2, InterruptedException { + public T execute(Callable 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; -- cgit v1.2.3