Package com.couchbase.client.core.msg.kv
Enum DurabilityLevel
- java.lang.Object
-
- java.lang.Enum<DurabilityLevel>
-
- com.couchbase.client.core.msg.kv.DurabilityLevel
-
- All Implemented Interfaces:
Serializable
,Comparable<DurabilityLevel>
public enum DurabilityLevel extends Enum<DurabilityLevel>
Specifies enhanced durability options for the mutation.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description 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
The mutation must be replicated to a majority of the Data Service nodes.NONE
No enhanced durability configured for the mutation.PERSIST_TO_MAJORITY
The mutation must be persisted to a majority of the Data Service nodes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
code()
static DurabilityLevel
decodeFromManagementApi(String input)
Decodes the string representation of the durability level from the management API into an enum.String
encodeForManagementApi()
Encodes theDurabilityLevel
so that the management API understands it.static DurabilityLevel
valueOf(String name)
Returns the enum constant of this type with the specified name.static DurabilityLevel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static DurabilityLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DurabilityLevel c : DurabilityLevel.values()) System.out.println(c);
- 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 nameNullPointerException
- 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 theDurabilityLevel
so that the management API understands it.- Returns:
- the encoded durability level for the management API.
-
-