@Beta public abstract class RateLimitRetryHandler extends Object implements HttpRetryHandler
| Modifier and Type | Field and Description |
|---|---|
protected Logger |
logger |
ALWAYS_RETRY, NEVER_RETRY| Constructor and Description |
|---|
RateLimitRetryHandler() |
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxRateLimitWait() |
int |
getRetryCountLimit() |
protected abstract com.google.common.base.Optional<Long> |
millisToNextAvailableRequest(HttpCommand command,
HttpResponse response)
Compute the number of milliseconds that must pass until a request can be
performed.
|
protected int |
rateLimitErrorStatus()
Returns the response status that will be considered a rate limit error.
|
boolean |
shouldRetryRequest(HttpCommand command,
HttpResponse response)
Return true if the command should be retried.
|
protected Logger logger
protected int rateLimitErrorStatus()
Providers can override this to customize which responses are retried.
protected abstract com.google.common.base.Optional<Long> millisToNextAvailableRequest(HttpCommand command, HttpResponse response)
command - The command being executed.response - The rate-limit error response.public boolean shouldRetryRequest(HttpCommand command, HttpResponse response)
HttpRetryHandlershouldRetryRequest in interface HttpRetryHandlerpublic int getRetryCountLimit()
public int getMaxRateLimitWait()
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.