Constructor and Description |
---|
OperationRetryer(org.apache.kafka.common.utils.Time time,
Duration maxRetryDuration,
Duration retryWaitDuration,
String operationDescription) |
Modifier and Type | Method and Description |
---|---|
T |
runWithRetries(RetryableOperation<T> operation)
Runs the given
RetryableOperation with an unlimited amount of retries,
waiting retryWaitDuration between retries
and retrying for a duration up to maxRetryDuration |
public T runWithRetries(RetryableOperation<T> operation) throws InterruptedException, StartupCheckInterruptedException, org.apache.kafka.common.errors.TimeoutException
RetryableOperation
with an unlimited amount of retries,
waiting retryWaitDuration
between retries
and retrying for a duration up to maxRetryDuration
RetryableOperation
operationInterruptedException
- in case the thread was interruptedStartupCheckInterruptedException
- in case this is used for Cruise Control start up and that was interruptedorg.apache.kafka.common.errors.TimeoutException
- in case the underlying operation could notRuntimeException
- for any other exceptions