Package org.apache.cassandra.db
Enum Class ConsistencyLevel
- All Implemented Interfaces:
Serializable,Comparable<ConsistencyLevel>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintblockFor(AbstractReplicationStrategy replicationStrategy) intblockForWrite(AbstractReplicationStrategy replicationStrategy, Endpoints<?> pending) static com.carrotsearch.hppc.ObjectIntHashMap<String>eachQuorumForRead(AbstractReplicationStrategy replicationStrategy) static com.carrotsearch.hppc.ObjectIntHashMap<String>eachQuorumForWrite(AbstractReplicationStrategy replicationStrategy, Endpoints<?> pendingWithDown) static ConsistencyLevelfromCode(int code) static ConsistencyLevelfromString(String str) booleanbooleanstatic intlocalQuorumFor(AbstractReplicationStrategy replicationStrategy, String dc) static intlocalQuorumForOurDc(AbstractReplicationStrategy replicationStrategy) booleanWith a replication factor greater than one, reads that contact more than one replica will require reconciliation of the individual replica results at the coordinator.static intquorumFor(AbstractReplicationStrategy replicationStrategy) booleansatisfies(ConsistencyLevel other, AbstractReplicationStrategy replicationStrategy) Determine if this consistency level meets or exceeds the consistency requirements of the given cl for the given keyspace WARNING: this is not locality aware; you cannot safely use this with mixed locality consistency levels (e.g.voidvalidateCounterForWrite(TableMetadata metadata) voidvoidvalidateForCasCommit(AbstractReplicationStrategy replicationStrategy) voidvoidstatic ConsistencyLevelReturns the enum constant of this class with the specified name.static ConsistencyLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANY
-
ONE
-
TWO
-
THREE
-
QUORUM
-
ALL
-
LOCAL_QUORUM
-
EACH_QUORUM
-
SERIAL
-
LOCAL_SERIAL
-
LOCAL_ONE
-
NODE_LOCAL
-
-
Field Details
-
code
public final int code
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
fromCode
-
fromString
-
quorumFor
-
localQuorumFor
-
localQuorumForOurDc
-
eachQuorumForRead
public static com.carrotsearch.hppc.ObjectIntHashMap<String> eachQuorumForRead(AbstractReplicationStrategy replicationStrategy) -
eachQuorumForWrite
public static com.carrotsearch.hppc.ObjectIntHashMap<String> eachQuorumForWrite(AbstractReplicationStrategy replicationStrategy, Endpoints<?> pendingWithDown) -
blockFor
-
blockForWrite
-
satisfies
Determine if this consistency level meets or exceeds the consistency requirements of the given cl for the given keyspace WARNING: this is not locality aware; you cannot safely use this with mixed locality consistency levels (e.g. LOCAL_QUORUM and QUORUM) -
isDatacenterLocal
public boolean isDatacenterLocal() -
validateForRead
- Throws:
InvalidRequestException
-
validateForWrite
- Throws:
InvalidRequestException
-
validateForCasCommit
public void validateForCasCommit(AbstractReplicationStrategy replicationStrategy) throws InvalidRequestException - Throws:
InvalidRequestException
-
validateForCas
- Throws:
InvalidRequestException
-
isSerialConsistency
public boolean isSerialConsistency() -
validateCounterForWrite
- Throws:
InvalidRequestException
-
needsReconciliation
public boolean needsReconciliation()With a replication factor greater than one, reads that contact more than one replica will require reconciliation of the individual replica results at the coordinator.- Returns:
- true if reads at this consistency level require merging at the coordinator
-