RetryExponentialRetry Class

public class RetryExponentialRetry extends RetryPolicy implements RetryPolicyFactory

Represents a retry policy that performs a specified number of retries, using a randomized exponential backoff scheme to determine the interval between retries.

This class extends the RetryPolicy class and implements the RetryPolicyFactory interface.

Constructor Summary

Constructor Description
RetryExponentialRetry()

Creates an instance of the class.

RetryExponentialRetry(final int deltaBackoff, final int maxAttempts)

Creates an instance of the class using the specified delta backoff and maximum retry attempts.

RetryExponentialRetry(final int minBackoff, final int deltaBackoff, final int maxBackOff, final int maxAttempts)

Creates an instance of the class using the specified minimum, maximum, and delta backoff amounts, and maximum number of retry attempts.

Method Summary

Modifier and Type Method and Description
RetryPolicy createInstance(final OperationContext opContext)

Generates a new retry policy for the current request attempt.

RetryInfo evaluate(RetryContext retryContext, OperationContext operationContext)

Determines whether the operation should be retried and specifies the interval until the next retry.

Inherited Members

Constructor Details

RetryExponentialRetry

public RetryExponentialRetry()

Creates an instance of the class.

RetryExponentialRetry

public RetryExponentialRetry(final int deltaBackoff, final int maxAttempts)

Creates an instance of the class using the specified delta backoff and maximum retry attempts.

Parameters:

deltaBackoff - The backoff interval, in milliseconds, between retries.
maxAttempts - The maximum number of retry attempts.

RetryExponentialRetry

public RetryExponentialRetry(final int minBackoff, final int deltaBackoff, final int maxBackOff, final int maxAttempts)

Creates an instance of the class using the specified minimum, maximum, and delta backoff amounts, and maximum number of retry attempts.

Parameters:

minBackoff - The minimum backoff interval, in milliseconds, between retries.
deltaBackoff - The backoff interval, in milliseconds, between retries.
maxBackOff - The maximum backoff interval, in milliseconds, between retries.
maxAttempts - The maximum retry attempts, in milliseconds, between retries.

Method Details

createInstance

public RetryPolicy createInstance(final OperationContext opContext)

Generates a new retry policy for the current request attempt.

Overrides:

RetryExponentialRetry.createInstance(final OperationContext opContext)

Parameters:

opContext - An OperationContext object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.

Returns:

A RetryPolicy object that represents the retry policy for the current request attempt.

evaluate

public RetryInfo evaluate(RetryContext retryContext, OperationContext operationContext)

Determines whether the operation should be retried and specifies the interval until the next retry.

Parameters:

retryContext - A RetryContext object that indicates the number of retries, last request's results, whether the next retry should happen in the primary or secondary location, and specifies the location mode.
operationContext - An OperationContext object for tracking the current operation.

Returns:

A RetryInfo object that indicates whether the next retry will happen in the primary or secondary location, and specifies the location mode. If null, the operation will not be retried.

Applies to