DefaultRetryHandler

class borneo.DefaultRetryHandler(retries=10, delay_s=0)[source]

Bases: borneo.config.RetryHandler

Default retry handler. It’s a default instance of RetryHandler 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.

Methods Summary

delay(request, num_retried, re) Delay (sleep) during retry cycle.
do_retry(request, num_retried, re) Decide whether to retry or not.
get_num_retries() Returns the number of retries that this handler instance will allow before the exception is thrown to the application.

Methods Documentation

delay(request, num_retried, re)[source]

Delay (sleep) during retry cycle. If delay_ms is non-zero, use it. Otherwise, use an incremental backoff algorithm to compute the time of delay.

do_retry(request, num_retried, re)[source]

Decide 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. In addition, not retry any requests that should not be retried: TableRequest, ListTablesRequest, GetTableRequest, TableUsageRequest, GetIndexesRequest.

get_num_retries()[source]

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.
Return type:int