Interface RetryHandler

    • Method Detail

      • getNumRetries

        int getNumRetries()
        Returns the number of retries that this handler instance will allow before the exception is thrown to the application.
        Returns:
        the max number of retries
      • doRetry

        boolean doRetry​(Request request,
                        int numRetries,
                        RetryableException re)
        This method is called when a RetryableException is thrown and determines whether to perform a retry or not based on the parameters.
        Parameters:
        request - the Request that has triggered the exception
        numRetries - the number of retries that have occurred for the operation
        re - the exception that was thrown
        Returns:
        true if the operation should be retried, false if not, causing the exception to be thrown to the application.
      • delay

        void delay​(Request request,
                   int numRetries,
                   RetryableException re)
        This method is called when a RetryableException is thrown and it is determined that the request will be retried based on the return value of doRetry(oracle.nosql.driver.ops.Request, int, oracle.nosql.driver.RetryableException). It provides a delay between retries. Most implementations will sleep for some period of time. The method should not return until the desired delay period has passed. Implementations should not busy-wait in a tight loop.
        Parameters:
        request - the Request that has triggered the exception
        numRetries - the number of retries that have occurred for the operation
        re - the exception that was thrown