Package org.elasticsearch.action.support
Class RetryableAction<Response>
org.elasticsearch.action.support.RetryableAction<Response>
public abstract class RetryableAction<Response>
extends
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
ConstructorDescriptionRetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.elasticsearch.core.TimeValue initialDelay, org.elasticsearch.core.TimeValue timeoutValue, ActionListener<Response> listener)
RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.elasticsearch.core.TimeValue initialDelay, org.elasticsearch.core.TimeValue timeoutValue, ActionListener<Response> listener, executor)
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
calculateDelay(long previousDelay)
void
e)
protected long
void
void
run()
abstract boolean
e)
abstract void
tryAction(ActionListener<Response> listener)
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Constructor Details
-
RetryableAction
public RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.elasticsearch.core.TimeValue initialDelay, org.elasticsearch.core.TimeValue timeoutValue, ActionListener<Response> listener) -
RetryableAction
public RetryableAction(org.apache.logging.log4j.Logger logger, ThreadPool threadPool, org.elasticsearch.core.TimeValue initialDelay, org.elasticsearch.core.TimeValue timeoutValue, ActionListener<Response> listener, executor)
-
-
Method Details
-
run
public void run() -
cancel
public void cancel( e) -
tryAction
-
shouldRetry
public abstract boolean shouldRetry( e) -
calculateDelay
protected long calculateDelay(long previousDelay) -
minimumDelayMillis
protected long minimumDelayMillis() -
onFinished
public void onFinished()
-