Enum ConsistencyLevel

java.lang.Object
java.lang.Enum<ConsistencyLevel>
com.azure.cosmos.ConsistencyLevel
All Implemented Interfaces:
Serializable, Comparable<ConsistencyLevel>, java.lang.constant.Constable

public enum ConsistencyLevel extends Enum<ConsistencyLevel>
Represents the consistency levels supported for Azure Cosmos DB client operations in the Azure Cosmos DB service.

The requested ConsistencyLevel must match or be weaker than that provisioned for the database account. Consistency levels by order of strength are STRONG, BOUNDED_STALENESS, SESSION and EVENTUAL. Refer to consistency level documentation for additional details: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Bounded Staleness guarantees that reads are not too out-of-date.
    CONSISTENT_PREFIX Consistency guarantees that reads will return some prefix of all writes with no gaps.
    EVENTUAL Consistency guarantees that reads will return a subset of writes.
    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.
    STRONG Consistency guarantees that read operations always return the value that was last written.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • STRONG

      public static final ConsistencyLevel STRONG
      STRONG Consistency guarantees that read operations always return the value that was last written.
    • BOUNDED_STALENESS

      public static final ConsistencyLevel BOUNDED_STALENESS
      Bounded Staleness guarantees that reads are not too out-of-date. This can be configured based on number of operations (MaxStalenessPrefix) or time (MaxStalenessIntervalInSeconds)
    • SESSION

      public static final ConsistencyLevel 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.
    • EVENTUAL

      public static final ConsistencyLevel EVENTUAL
      EVENTUAL Consistency guarantees that reads will return a subset of writes. ALL writes will be eventually be available for reads.
    • CONSISTENT_PREFIX

      public static final ConsistencyLevel CONSISTENT_PREFIX
      CONSISTENT_PREFIX Consistency guarantees that reads will return some prefix of all writes with no gaps. ALL writes will be eventually be available for reads.
  • Method Details

    • values

      public static ConsistencyLevel[] 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

      public static ConsistencyLevel valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ConsistencyLevel>