Package com.cloudera.cdp.http
Interface RetryHandler
-
- All Known Implementing Classes:
NeverRetryHandler
,SimpleRetryHandler
public interface RetryHandler
An interface for handling retries.
-
-
Field Summary
Fields Modifier and Type Field Description static Duration
DO_NOT_RETRY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Duration
shouldRetry(int attempts, CdpClientException exception)
Returns the duration the caller need to wait before retrying or null if no retry should be attempted according to the retry policy.
-
-
-
Field Detail
-
DO_NOT_RETRY
static final Duration DO_NOT_RETRY
-
-
Method Detail
-
shouldRetry
Duration shouldRetry(int attempts, CdpClientException exception)
Returns the duration the caller need to wait before retrying or null if no retry should be attempted according to the retry policy.- Parameters:
attempts
- the number of attempts so farexception
- the request exception- Returns:
- the duration to wait for the next attempt or null if no retry should be attempted
-
-