Class RetryLimitPolicy

java.lang.Object
org.apache.ignite.client.RetryLimitPolicy
All Implemented Interfaces:
RetryPolicy
Direct Known Subclasses:
RetryReadPolicy

public class RetryLimitPolicy extends Object implements RetryPolicy
Retry policy that returns true when RetryPolicyContext.iteration() is less than the specified retryLimit().
  • Field Details

    • DFLT_RETRY_LIMIT

      public static final int DFLT_RETRY_LIMIT
      Default 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

      public RetryLimitPolicy retryLimit(int retryLimit)
      Sets the retry limit. 0 for no retries. -1 or less for unlimited retries.
      Returns:
      this instance.
    • shouldRetry

      public boolean shouldRetry(RetryPolicyContext context)
      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 interface RetryPolicy
      Parameters:
      context - Context.
      Returns:
      true if the operation should be retried on another connection, false otherwise.