Package org.apache.ignite.client
Class RetryLimitPolicy
java.lang.Object
org.apache.ignite.client.RetryLimitPolicy
- All Implemented Interfaces:
RetryPolicy
- Direct Known Subclasses:
RetryReadPolicy
Retry policy that returns true when
RetryPolicyContext.iteration()
is less than the specified retryLimit()
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the retry limit.retryLimit
(int retryLimit) Sets the retry limit.boolean
shouldRetry
(RetryPolicyContext context) Gets a value indicating whether a client operation that has failed due to a connection issue should be retried.
-
Field Details
-
DFLT_RETRY_LIMIT
public static final int DFLT_RETRY_LIMITDefault retry limit.- See Also:
-
-
Constructor Details
-
RetryLimitPolicy
public RetryLimitPolicy()
-
-
Method Details
-
retryLimit
public int retryLimit()Gets the retry limit. 0 or less for no limit.- Returns:
- Retry limit.
-
retryLimit
Sets the retry limit. 0 for no retries. -1 or less for unlimited retries.- Returns:
- this instance.
-
shouldRetry
Gets a value indicating whether a client operation that has failed due to a connection issue should be retried.If an implementation of this method throws an exception, the operation will be failed with that exception. No more retries will be attempted.
- Specified by:
shouldRetry
in interfaceRetryPolicy
- Parameters:
context
- Context.- Returns:
true
if the operation should be retried on another connection,false
otherwise.
-