diff --git a/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java b/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java index f31da61ecd..3c9d3cda1c 100644 --- a/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java +++ b/curator-client/src/main/java/org/apache/curator/retry/BoundedExponentialBackoffRetry.java @@ -45,7 +45,7 @@ public int getMaxSleepTimeMs() } @Override - protected int getSleepTimeMs(int retryCount, long elapsedTimeMs) + protected long getSleepTimeMs(int retryCount, long elapsedTimeMs) { return Math.min(maxSleepTimeMs, super.getSleepTimeMs(retryCount, elapsedTimeMs)); } diff --git a/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java b/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java index 1aed9a8ddc..421e2b245a 100644 --- a/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java +++ b/curator-client/src/main/java/org/apache/curator/retry/ExponentialBackoffRetry.java @@ -65,10 +65,10 @@ public int getBaseSleepTimeMs() } @Override - protected int getSleepTimeMs(int retryCount, long elapsedTimeMs) + protected long getSleepTimeMs(int retryCount, long elapsedTimeMs) { // copied from Hadoop's RetryPolicies.java - int sleepMs = baseSleepTimeMs * Math.max(1, random.nextInt(1 << (retryCount + 1))); + long sleepMs = baseSleepTimeMs * Math.max(1, random.nextInt(1 << (retryCount + 1))); if ( sleepMs > maxSleepMs ) { log.warn(String.format("Sleep extension too large (%d). Pinning to %d", sleepMs, maxSleepMs)); diff --git a/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java b/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java index 6e0ff0e6a2..234b2416d8 100644 --- a/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java +++ b/curator-client/src/main/java/org/apache/curator/retry/RetryNTimes.java @@ -32,7 +32,7 @@ public RetryNTimes(int n, int sleepMsBetweenRetries) } @Override - protected int getSleepTimeMs(int retryCount, long elapsedTimeMs) + protected long getSleepTimeMs(int retryCount, long elapsedTimeMs) { return sleepMsBetweenRetries; } diff --git a/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java b/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java index cd1953c92b..3b11268b60 100644 --- a/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java +++ b/curator-client/src/main/java/org/apache/curator/retry/RetryUntilElapsed.java @@ -42,7 +42,7 @@ public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleep } @Override - protected int getSleepTimeMs(int retryCount, long elapsedTimeMs) + protected long getSleepTimeMs(int retryCount, long elapsedTimeMs) { return sleepMsBetweenRetries; } diff --git a/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java b/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java index 6f0a1fb338..22d2b33a0c 100644 --- a/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java +++ b/curator-client/src/main/java/org/apache/curator/retry/SleepingRetry.java @@ -55,5 +55,5 @@ public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleep return false; } - protected abstract int getSleepTimeMs(int retryCount, long elapsedTimeMs); + protected abstract long getSleepTimeMs(int retryCount, long elapsedTimeMs); }