public enum DefaultConsistencyLevel extends Enum<DefaultConsistencyLevel> implements ConsistencyLevel
Enum Constant and Description |
---|
ALL |
ANY |
EACH_QUORUM |
LOCAL_ONE |
LOCAL_QUORUM |
LOCAL_SERIAL |
ONE |
QUORUM |
SERIAL |
THREE |
TWO |
ALL, ANY, EACH_QUORUM, LOCAL_ONE, LOCAL_QUORUM, LOCAL_SERIAL, ONE, QUORUM, SERIAL, THREE, TWO
Modifier and Type | Method and Description |
---|---|
static DefaultConsistencyLevel |
fromCode(int code) |
int |
getProtocolCode()
The numerical value that the level is encoded to in protocol frames.
|
boolean |
isDcLocal()
Whether this consistency level applies to the local datacenter only.
|
boolean |
isSerial()
Whether this consistency level is serial, that is, applies only to the "paxos" phase of a lightweight
transaction.
|
static DefaultConsistencyLevel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DefaultConsistencyLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
name
public static final DefaultConsistencyLevel ANY
public static final DefaultConsistencyLevel ONE
public static final DefaultConsistencyLevel TWO
public static final DefaultConsistencyLevel THREE
public static final DefaultConsistencyLevel QUORUM
public static final DefaultConsistencyLevel ALL
public static final DefaultConsistencyLevel LOCAL_ONE
public static final DefaultConsistencyLevel LOCAL_QUORUM
public static final DefaultConsistencyLevel EACH_QUORUM
public static final DefaultConsistencyLevel SERIAL
public static final DefaultConsistencyLevel LOCAL_SERIAL
public static DefaultConsistencyLevel[] values()
for (DefaultConsistencyLevel c : DefaultConsistencyLevel.values()) System.out.println(c);
public static DefaultConsistencyLevel 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 nullpublic int getProtocolCode()
ConsistencyLevel
getProtocolCode
in interface ConsistencyLevel
@NonNull public static DefaultConsistencyLevel fromCode(int code)
public boolean isDcLocal()
ConsistencyLevel
isDcLocal
in interface ConsistencyLevel
public boolean isSerial()
ConsistencyLevel
Serial consistency levels are only meaningful when executing conditional updates (INSERT
, UPDATE
or DELETE
statements with an IF
condition).
isSerial
in interface ConsistencyLevel
Copyright © 2017–2021. All rights reserved.