Package oracle.nosql.driver
Class DefaultRetryHandler
java.lang.Object
oracle.nosql.driver.DefaultRetryHandler
- All Implemented Interfaces:
- RetryHandler
Default retry handler.
 This may be extended by clients for specific use cases.
 The default retry handler decides when and for how long retries will
 be attempted. See 
RetryHandler for more information on
 retry handlers.- 
Method SummaryModifier and TypeMethodDescriptionstatic intcomputeBackoffDelay(Request request, int fixedDelayMs) Compute an incremental backoff delay in milliseconds.voiddelay(Request request, int numRetries, RetryableException re) Delay (sleep) during retry cycle.booleandoRetry(Request request, int numRetries, RetryableException re) Decide whether to retry or not.intReturns the number of retries that this handler instance will allow before the exception is thrown to the application.
- 
Method Details- 
getNumRetriespublic int getNumRetries()Description copied from interface:RetryHandlerReturns the number of retries that this handler instance will allow before the exception is thrown to the application.- Specified by:
- getNumRetriesin interface- RetryHandler
- Returns:
- the max number of retries
 
- 
doRetryDecide whether to retry or not. Default behavior is to *not* retry OperationThrottlingException because the retry time is likely much longer than normal because they are DDL operations. Read and Write throttling exceptions are always retryable. Otherwise check the request itself to see if it should not be retried.- Specified by:
- doRetryin interface- RetryHandler
- 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.
 
- 
delayDelay (sleep) during retry cycle. If delayMS is non-zero, use it. Otherwise, use an incremental backoff algorithm to compute the time of delay.- Specified by:
- delayin interface- RetryHandler
- 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
 
- 
computeBackoffDelayCompute an incremental backoff delay in milliseconds. This method also checks the request's timeout and ensures the delay will not exceed the specified timeout.- Parameters:
- request- The request object being executed
- fixedDelayMs- A specific delay to use and check for timeout. Pass zero to use the default backoff logic.
- Returns:
- The number of milliseconds to delay. If zero, do not delay at all.
 
 
-