Package alluxio.retry
Interface RetryPolicy
-
- All Known Implementing Classes:
CountingRetry
,ExponentialBackoffRetry
,ExponentialTimeBoundedRetry
,SleepingRetry
,TimeBoundedRetry
,TimeoutRetry
@NotThreadSafe public interface RetryPolicy
Policy for determining whether retries should be performed, and potentially waiting for some time before the next retry attempt. The way that this interface works is that the logic for delayed retries (retries that sleep) can delay the caller ofattempt()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
attempt()
Waits until it is time to perform the next retry, then returns.int
getAttemptCount()
How many retries have been performed.
-
-
-
Method Detail
-
getAttemptCount
int getAttemptCount()
How many retries have been performed. If no retries have been performed, 0 is returned.- Returns:
- number of retries performed
-
attempt
boolean attempt()
Waits until it is time to perform the next retry, then returns. Returns false if no further retries should be performed. The first call to this method should never delay the caller, this allow users of the policy to use it in the context of a while-loop.- Returns:
- whether another retry should be performed
-
-