Enum DurabilityLevel

java.lang.Object
java.lang.Enum<DurabilityLevel>
com.couchbase.client.core.msg.kv.DurabilityLevel
All Implemented Interfaces:
Serializable, Comparable<DurabilityLevel>, java.lang.constant.Constable

public enum DurabilityLevel extends Enum<DurabilityLevel>
Specifies enhanced durability options for the mutation.
  • Enum Constant Details

    • NONE

      public static final DurabilityLevel NONE
      No enhanced durability configured for the mutation.
    • MAJORITY

      public static final DurabilityLevel MAJORITY
      The mutation must be replicated to (that is, held in the memory allocated to the bucket on) a majority of the Data Service nodes.
    • MAJORITY_AND_PERSIST_TO_ACTIVE

      public static final DurabilityLevel MAJORITY_AND_PERSIST_TO_ACTIVE
      The mutation must be replicated to a majority of the Data Service nodes.

      Additionally, it must be persisted (that is, written and synchronised to disk) on the node hosting the active partition (vBucket) for the data.

    • PERSIST_TO_MAJORITY

      public static final DurabilityLevel PERSIST_TO_MAJORITY
      The mutation must be persisted to a majority of the Data Service nodes.

      Accordingly, it will be written to disk on those nodes.

  • Method Details

    • values

      public static DurabilityLevel[] 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 DurabilityLevel 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
    • code

      @Internal public byte code()
    • decodeFromManagementApi

      @Internal public static DurabilityLevel decodeFromManagementApi(String input)
      Decodes the string representation of the durability level from the management API into an enum.
      Parameters:
      input - the management API string.
      Returns:
      the encoded durability enum. Note that it will be NONE if input is null or unknown.
    • encodeForManagementApi

      @Internal public String encodeForManagementApi()
      Encodes the DurabilityLevel so that the management API understands it.
      Returns:
      the encoded durability level for the management API.