public final class RetryUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
RetryUtils.RunnableThrowsIOException
Interface for methods which return nothing and may throw IOException.
|
Modifier and Type | Method and Description |
---|---|
static RetryPolicy |
defaultActiveSyncClientRetry(long activeUfsPollTimeoutMs) |
static RetryPolicy |
defaultBlockReadRetry(java.time.Duration maxRetryDuration,
java.time.Duration baseSleepMs,
java.time.Duration maxSleepMs)
Gives a ClientRetry based on the given parameters.
|
static RetryPolicy |
defaultClientRetry(java.time.Duration maxRetryDuration,
java.time.Duration baseSleepMs,
java.time.Duration maxSleepMs)
Gives a ClientRetry based on the given parameters.
|
static RetryPolicy |
defaultFileWriteInitRetry(java.time.Duration maxRetryDuration,
java.time.Duration baseSleepMs,
java.time.Duration maxSleepMs)
Gives a RetryPolicy for initialization of writing a file.
|
static RetryPolicy |
defaultMetricsClientRetry() |
static RetryPolicy |
defaultWorkerMasterClientRetry(java.time.Duration workerMasterConnectRetryTimeout) |
static RetryPolicy |
noRetryPolicy() |
static void |
retry(String action,
RetryUtils.RunnableThrowsIOException f,
RetryPolicy policy)
Retries the given method until it doesn't throw an IO exception or the retry policy expires.
|
public static void retry(String action, RetryUtils.RunnableThrowsIOException f, RetryPolicy policy) throws IOException
action
- a description of the action that fits the phrase "Failed to ${action}"f
- the function to retrypolicy
- the retry policy to useIOException
public static RetryPolicy noRetryPolicy()
public static RetryPolicy defaultClientRetry(java.time.Duration maxRetryDuration, java.time.Duration baseSleepMs, java.time.Duration maxSleepMs)
maxRetryDuration
- the maximum total duration to retry forbaseSleepMs
- initial sleep time in millisecondsmaxSleepMs
- max sleep time in millisecondspublic static RetryPolicy defaultWorkerMasterClientRetry(java.time.Duration workerMasterConnectRetryTimeout)
workerMasterConnectRetryTimeout
- the max duration to wait between retrying for worker
and masterpublic static RetryPolicy defaultMetricsClientRetry()
public static RetryPolicy defaultActiveSyncClientRetry(long activeUfsPollTimeoutMs)
activeUfsPollTimeoutMs
- the max time in milliseconds to wait for active ufs sync retriespublic static RetryPolicy defaultBlockReadRetry(java.time.Duration maxRetryDuration, java.time.Duration baseSleepMs, java.time.Duration maxSleepMs)
maxRetryDuration
- the maximum total duration to retry forbaseSleepMs
- initial sleep time in millisecondsmaxSleepMs
- max sleep time in millisecondspublic static RetryPolicy defaultFileWriteInitRetry(java.time.Duration maxRetryDuration, java.time.Duration baseSleepMs, java.time.Duration maxSleepMs)
maxRetryDuration
- the maximum total duration to retry forbaseSleepMs
- initial sleep time in millisecondsmaxSleepMs
- max sleep time in millisecondsCopyright © 2023. All Rights Reserved.