Compartilhar via


RequestRetryOptions Class

  • java.lang.Object
    • com.azure.storage.common.policy.RequestRetryOptions

public final class RequestRetryOptions

Configuration options for RequestRetryPolicy.

Constructor Summary

Constructor Description
RequestRetryOptions()

Configures how the HttpPipeline should retry requests.

RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Integer tryTimeoutInSeconds, Long retryDelayInMs, Long maxRetryDelayInMs, String secondaryHost)

Configures how the HttpPipeline should retry requests.

RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Duration tryTimeout, Duration retryDelay, Duration maxRetryDelay, String secondaryHost)

Configures how the HttpPipeline should retry requests.

Method Summary

Modifier and Type Method and Description
static RequestRetryOptions fromRetryOptions(RetryOptions retryOptions, Duration tryTimeout, String secondaryHost)

Creates new RequestRetryOptions from RetryOptions and let specify storage specific parameters.

Duration getMaxRetryDelay()

Gets the maximum delay allowed between each retry.

long getMaxRetryDelayInMs()

Deprecated

Gets the maximum delay in milliseconds allowed between each retry.

int getMaxTries()

Gets the maximum number of retries that will be attempted.

Duration getRetryDelay()

Gets the delay between each retry attempt.

long getRetryDelayInMs()

Deprecated

Gets the delay in milliseconds between each retry attempt.

String getSecondaryHost()

Gets the URI of the secondary host where retries are attempted.

int getTryTimeout()

Deprecated

Gets the maximum time, in seconds, allowed for a request until it is considered timed out.

Duration getTryTimeoutDuration()

Gets the maximum time allowed for a request until it is considered timed out.

Methods inherited from java.lang.Object

Constructor Details

RequestRetryOptions

public RequestRetryOptions()

Configures how the HttpPipeline should retry requests.

RequestRetryOptions

public RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Integer tryTimeoutInSeconds, Long retryDelayInMs, Long maxRetryDelayInMs, String secondaryHost)

Configures how the HttpPipeline should retry requests.

Parameters:

retryPolicyType - Optional. A RetryPolicyType specifying the type of retry pattern to use, default value is EXPONENTIAL.
maxTries - Optional. Maximum number of attempts an operation will be retried, default is 4.
tryTimeoutInSeconds - Optional. Specified the maximum time allowed before a request is cancelled and assumed failed, default is Integer#MAX_VALUE s. This value should be based on the bandwidth available to the host machine and proximity to the Storage service, a good starting point may be 60 seconds per MB of anticipated payload size.
retryDelayInMs - Optional. Specifies the amount of delay to use before retrying an operation, default value is 4ms when retryPolicyType is EXPONENTIAL and 30ms when retryPolicyType is FIXED.
maxRetryDelayInMs - Optional. Specifies the maximum delay allowed before retrying an operation, default value is 120ms.
secondaryHost - Optional. Specified a secondary Storage account to retry requests against, default is none. Before setting this understand the issues around reading stale and potentially-inconsistent data, view these Azure Docs for more information.

RequestRetryOptions

public RequestRetryOptions(RetryPolicyType retryPolicyType, Integer maxTries, Duration tryTimeout, Duration retryDelay, Duration maxRetryDelay, String secondaryHost)

Configures how the HttpPipeline should retry requests.

Parameters:

retryPolicyType - Optional. A RetryPolicyType specifying the type of retry pattern to use, default value is EXPONENTIAL.
maxTries - Optional. Maximum number of attempts an operation will be retried, default is 4.
tryTimeout - Optional. Specified the maximum time allowed before a request is cancelled and assumed failed, default is Integer#MAX_VALUE. This value should be based on the bandwidth available to the host machine and proximity to the Storage service, a good starting point may be 60 seconds per MB of anticipated payload size.
retryDelay - Optional. Specifies the amount of delay to use before retrying an operation, default value is 4s when retryPolicyType is EXPONENTIAL and 30s when retryPolicyType is FIXED.
maxRetryDelay - Optional. Specifies the maximum delay allowed before retrying an operation, default value is 120s.
secondaryHost - Optional. Specified a secondary Storage account to retry requests against, default is none. Before setting this understand the issues around reading stale and potentially-inconsistent data, view these Azure Docs for more information.

Method Details

fromRetryOptions

public static RequestRetryOptions fromRetryOptions(RetryOptions retryOptions, Duration tryTimeout, String secondaryHost)

Creates new RequestRetryOptions from RetryOptions and let specify storage specific parameters.

Parameters:

retryOptions - The RetryOptions.
tryTimeout - Optional. Specified the maximum time allowed before a request is cancelled and assumed failed, default is Integer#MAX_VALUE.
secondaryHost - Optional. Specified a secondary Storage account to retry requests against, default is none.

Returns:

getMaxRetryDelay

public Duration getMaxRetryDelay()

Gets the maximum delay allowed between each retry.

Returns:

the maximum delay allowed between each retry.

getMaxRetryDelayInMs

@Deprecated
public long getMaxRetryDelayInMs()

Deprecated

Gets the maximum delay in milliseconds allowed between each retry.

Returns:

the maximum delay in milliseconds allowed between each retry.

getMaxTries

public int getMaxTries()

Gets the maximum number of retries that will be attempted.

Returns:

the maximum number of retries that will be attempted.

getRetryDelay

public Duration getRetryDelay()

Gets the delay between each retry attempt.

Returns:

the delay between each retry attempt.

getRetryDelayInMs

@Deprecated
public long getRetryDelayInMs()

Deprecated

Gets the delay in milliseconds between each retry attempt.

Returns:

the delay in milliseconds between each retry attempt.

getSecondaryHost

public String getSecondaryHost()

Gets the URI of the secondary host where retries are attempted. If this is null then there is no secondary host and all retries are attempted against the original host.

Returns:

the URI of the secondary host where retries are attempted. If this is null then there is no secondary host and all retries are attempted against the original host.

getTryTimeout

@Deprecated
public int getTryTimeout()

Deprecated

Gets the maximum time, in seconds, allowed for a request until it is considered timed out.

Returns:

the maximum time, in seconds, allowed for a request until it is considered timed out.

getTryTimeoutDuration

public Duration getTryTimeoutDuration()

Gets the maximum time allowed for a request until it is considered timed out.

Returns:

the maximum time allowed for a request until it is considered timed out.

Applies to