Package com.azure.cosmos
Enum ReadConsistencyStrategy
- All Implemented Interfaces:
Serializable
,Comparable<ReadConsistencyStrategy>
,java.lang.constant.Constable
@Beta(value=V4_69_0,
warningText="Preview API - subject to change in non-backwards compatible way")
public enum ReadConsistencyStrategy
extends Enum<ReadConsistencyStrategy>
Represents the read consistency strategies supported by the Azure Cosmos DB service.
The requested read consistency strategy can be chosen independent of the consistency level provisioned for the database account.
The ReadConsistencyStrategy setting will override whatever ConsistencyLevel is chosen in RequestOptions, CosmosClient or the default consistency level for an account unless ReadConsistencyStrategy `DEFAULT` is used.
NOTE: The ReadConsistencyStrategy is currently only working when using direct mode
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUse the default read behavior for the consistency level applied to the operation, the client or the accountEventual Consistency guarantees that reads will return a subset of writes.Will read the latest version - since replication with global strong consistency is synchronous this read consistency strategy ensures that the latest successfully written version across regions is returned.Will read the latest committed version from the region in preferred order (which means the read region might have stale data) but this read strategy will return the latest committed version of that regionSession Consistency guarantees monotonic reads (you never read old data, then new, then old again), monotonic writes (writes are ordered) and read your writes (your writes are immediately visible to your reads) within any single session. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
static ReadConsistencyStrategy
Returns the enum constant of this type with the specified name.static ReadConsistencyStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Use the default read behavior for the consistency level applied to the operation, the client or the account -
EVENTUAL
Eventual Consistency guarantees that reads will return a subset of writes. All writes will be eventually be available for reads. -
SESSION
Session Consistency guarantees monotonic reads (you never read old data, then new, then old again), monotonic writes (writes are ordered) and read your writes (your writes are immediately visible to your reads) within any single session. -
LATEST_COMMITTED
Will read the latest committed version from the region in preferred order (which means the read region might have stale data) but this read strategy will return the latest committed version of that region -
GLOBAL_STRONG
Will read the latest version - since replication with global strong consistency is synchronous this read consistency strategy ensures that the latest successfully written version across regions is returned. NOTE: Only supported for single-master accounts with Strong consistency enabled as default consistency.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
- Overrides:
toString
in classEnum<ReadConsistencyStrategy>
-