@InterfaceAudience.Private public class RetryCounter extends Object
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.RetryCounterFactory
限定符和类型 | 类和说明 |
---|---|
static class |
RetryCounter.BackoffPolicy
Policy for calculating sleeping intervals between retry attempts
|
static class |
RetryCounter.ExponentialBackoffPolicy |
static class |
RetryCounter.ExponentialBackoffPolicyWithLimit |
static class |
RetryCounter.RetryConfig
Configuration for a retry counter
|
构造器和说明 |
---|
RetryCounter(int maxAttempts,
long sleepInterval,
TimeUnit timeUnit) |
RetryCounter(RetryCounter.RetryConfig retryConfig) |
限定符和类型 | 方法和说明 |
---|---|
int |
getAttemptTimes() |
long |
getBackoffTime() |
long |
getBackoffTimeAndIncrementAttempts() |
int |
getMaxAttempts() |
boolean |
isRetry() |
boolean |
shouldRetry() |
void |
sleepUntilNextRetry()
Sleep for a back off time as supplied by the backoff policy, and increases the attempts
|
void |
useRetry() |
public RetryCounter(int maxAttempts, long sleepInterval, TimeUnit timeUnit)
public RetryCounter(RetryCounter.RetryConfig retryConfig)
public int getMaxAttempts()
public void sleepUntilNextRetry() throws InterruptedException
public boolean shouldRetry()
public void useRetry()
public boolean isRetry()
public int getAttemptTimes()
public long getBackoffTime()
public long getBackoffTimeAndIncrementAttempts()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.