Module org.elasticsearch.server
Package org.elasticsearch.action.support
Class RetryableAction<Response>
java.lang.Object
org.elasticsearch.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.-
Constructor Summary
ConstructorsConstructorDescriptionRetryableAction
(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, TimeValue initialDelay, TimeValue timeoutValue, ActionListener<Response> listener, Executor executor) RetryableAction
(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, TimeValue initialDelay, TimeValue maxDelayBound, TimeValue timeoutValue, ActionListener<Response> listener, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
calculateDelayBound
(long previousDelayBound) void
void
void
run()
abstract boolean
abstract void
tryAction
(ActionListener<Response> listener)
-
Constructor Details
-
RetryableAction
public RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, TimeValue initialDelay, TimeValue timeoutValue, ActionListener<Response> listener, Executor executor) -
RetryableAction
public RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, TimeValue initialDelay, TimeValue maxDelayBound, TimeValue timeoutValue, ActionListener<Response> listener, Executor executor)
-
-
Method Details
-
run
public void run() -
cancel
-
tryAction
-
shouldRetry
-
calculateDelayBound
protected long calculateDelayBound(long previousDelayBound) -
onFinished
public void onFinished()
-