Package org.opensearch.action.support
Class RetryableAction<Response>
java.lang.Object
org.opensearch.action.support.RetryableAction<Response>
A action that will be retried on failure if
shouldRetry(Exception)
returns true.
The executor the action will be executed on can be defined in the constructor. Otherwise, SAME is the
default. The action will be retried with exponentially increasing delay periods until the timeout period
has been reached.- Opensearch.api:
-
Constructor Summary
ConstructorsConstructorDescriptionRetryableAction
(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.opensearch.common.unit.TimeValue initialDelay, org.opensearch.common.unit.TimeValue timeoutValue, org.opensearch.core.action.ActionListener<Response> listener) RetryableAction
(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.opensearch.common.unit.TimeValue initialDelay, org.opensearch.common.unit.TimeValue timeoutValue, org.opensearch.core.action.ActionListener<Response> listener, BackoffPolicy backoffPolicy, String executor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Retry able task may want to throw different Exception on timeout, they can override it method for that.void
void
run()
abstract boolean
abstract void
-
Constructor Details
-
RetryableAction
public RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.opensearch.common.unit.TimeValue initialDelay, org.opensearch.common.unit.TimeValue timeoutValue, org.opensearch.core.action.ActionListener<Response> listener) -
RetryableAction
public RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.opensearch.common.unit.TimeValue initialDelay, org.opensearch.common.unit.TimeValue timeoutValue, org.opensearch.core.action.ActionListener<Response> listener, BackoffPolicy backoffPolicy, String executor)
-
-
Method Details
-
run
public void run() -
cancel
-
tryAction
-
shouldRetry
-
onFinished
public void onFinished() -
getTimeoutException
Retry able task may want to throw different Exception on timeout, they can override it method for that.
-