Package org.apache.hadoop.hbase.util
Class RetryCounter
java.lang.Object
org.apache.hadoop.hbase.util.RetryCounter
Operation retry accounting. Use to calculate wait period,
getBackoffTimeAndIncrementAttempts()
}, or for performing wait,
sleepUntilNextRetry()
, in accordance with a RetryCounter.RetryConfig
, initial settings, and a
Retry Policy, (See org.apache.hadoop.io.retry.RetryPolicy). Like guava-retrying.- Since:
- 0.92.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Policy for calculating sleeping intervals between retry attemptsstatic class
static class
static class
Configuration for a retry counter -
Field Summary
Modifier and TypeFieldDescriptionprivate int
private static final org.slf4j.Logger
private RetryCounter.RetryConfig
-
Constructor Summary
ConstructorDescriptionRetryCounter
(int maxAttempts, long sleepInterval, TimeUnit timeUnit) RetryCounter
(RetryCounter.RetryConfig retryConfig) -
Method Summary
-
Field Details
-
LOG
-
retryConfig
-
attempts
-
-
Constructor Details
-
RetryCounter
-
RetryCounter
-
-
Method Details
-
addJitter
-
getMaxAttempts
-
sleepUntilNextRetry
Sleep for a back off time as supplied by the backoff policy, and increases the attempts- Throws:
InterruptedException
-
shouldRetry
-
useRetry
-
isRetry
-
getAttemptTimes
-
getBackoffTime
-
getBackoffTimeAndIncrementAttempts
-