public enum CosmosRetryPolicyOption extends Enum<CosmosRetryPolicyOption> implements CosmosDriverOption
| Enum Constant and Description |
|---|
FIXED_BACKOFF_TIME
Fixed back-off time for delayed retries triggered by
CosmosRetryPolicy.onErrorResponse(com.datastax.oss.driver.api.core.session.Request, com.datastax.oss.driver.api.core.servererrors.CoordinatorException, int). |
GROWING_BACKOFF_TIME
Growing back-off time for delayed retries triggered by
CosmosRetryPolicy.onErrorResponse(com.datastax.oss.driver.api.core.session.Request, com.datastax.oss.driver.api.core.servererrors.CoordinatorException, int). |
MAX_RETRIES
Maximum number of retries to attempt.
|
READ_TIMEOUT_RETRIES
A value indicating whether read timeout retries are enabled.
|
WRITE_TIMEOUT_RETRIES
A value indicating whether write timeout retries are enabled.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getDefaultValue(Class<T> type)
Returns the default value of this
Cosmos driver option. |
String |
getName()
Returns the name this
Cosmos driver option. |
String |
getPath() |
<T> T |
getValue(com.datastax.oss.driver.api.core.config.DriverExecutionProfile profile,
Class<T> type)
Gets the value for this
Cosmos driver option from the given driver execution profile. |
<T> T |
parse(String value,
Class<T> type)
Parses a value for this
Cosmos driver option. |
static CosmosRetryPolicyOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CosmosRetryPolicyOption[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CosmosRetryPolicyOption FIXED_BACKOFF_TIME
CosmosRetryPolicy.onErrorResponse(com.datastax.oss.driver.api.core.session.Request, com.datastax.oss.driver.api.core.servererrors.CoordinatorException, int).
Delays are triggered in response to OverloadedException errors. The delay time is extracted from the
error message, or--if the delay time isn't present in the error message--computed as follows:
this.maxRetryCount == -1
? fixedBackOffTimeInMillis
: retryCount * growingBackOffTimeInMillis + saltValue;
public static final CosmosRetryPolicyOption GROWING_BACKOFF_TIME
CosmosRetryPolicy.onErrorResponse(com.datastax.oss.driver.api.core.session.Request, com.datastax.oss.driver.api.core.servererrors.CoordinatorException, int).
Delays are triggered in response to OverloadedException errors. The delay time is extracted from the
error message, or--if the delay time isn't present in the error message--computed as follows:
this.maxRetryCount == -1
? fixedBackOffTimeInMillis
: retryCount * growingBackOffTimeInMillis + saltValue;
public static final CosmosRetryPolicyOption MAX_RETRIES
A value of -1 indicates that an indefinite number of retries should be attempted.
public static final CosmosRetryPolicyOption READ_TIMEOUT_RETRIES
Disabling read timeout retries may be desirable when Cosmos DB server-side retries are enabled.
public static final CosmosRetryPolicyOption WRITE_TIMEOUT_RETRIES
Disabling write timeout retries may be desirable when Cosmos DB server-side retries are enabled.
public static CosmosRetryPolicyOption[] values()
for (CosmosRetryPolicyOption c : CosmosRetryPolicyOption.values()) System.out.println(c);
public static CosmosRetryPolicyOption valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null@NonNull
public <T> T getDefaultValue(@NonNull
Class<T> type)
CosmosDriverOptionCosmos driver option.getDefaultValue in interface CosmosDriverOptionT - The class of values for this Cosmos driver option.type - The class of values for this Cosmos driver option.Cosmos driver option.@NonNull public String getName()
CosmosDriverOptionCosmos driver option.getName in interface CosmosDriverOptionCosmos driver option.@NonNull public String getPath()
getPath in interface com.datastax.oss.driver.api.core.config.DriverOption@NonNull
public <T> T getValue(@NonNull
com.datastax.oss.driver.api.core.config.DriverExecutionProfile profile,
@NonNull
Class<T> type)
CosmosDriverOptionCosmos driver option from the given driver execution profile.getValue in interface CosmosDriverOptionT - The class of values for this Cosmos driver option.profile - A driver execution profile from which to get the value.type - The class of values for this Cosmos driver option.Cosmos driver option.@NonNull
public <T> T parse(@Nullable
String value,
@NonNull
Class<T> type)
CosmosDriverOptionCosmos driver option.parse in interface CosmosDriverOptionT - The class of values for this Cosmos driver option.value - A string value to parse.type - The class of values for this Cosmos driver option.Cosmos driver option.Copyright © 2021. All rights reserved.