public enum ConsistencyLevel extends java.lang.Enum<ConsistencyLevel>
Enum Constant and Description |
---|
ALL |
ANY |
EACH_QUORUM |
LOCAL_ONE |
LOCAL_QUORUM |
LOCAL_SERIAL |
NODE_LOCAL |
ONE |
QUORUM |
SERIAL |
THREE |
TWO |
Modifier and Type | Field and Description |
---|---|
int |
code |
Modifier and Type | Method and Description |
---|---|
int |
blockFor(AbstractReplicationStrategy replicationStrategy) |
int |
blockForWrite(AbstractReplicationStrategy replicationStrategy,
Endpoints<?> pending) |
static com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> |
eachQuorumForRead(AbstractReplicationStrategy replicationStrategy) |
static com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> |
eachQuorumForWrite(AbstractReplicationStrategy replicationStrategy,
Endpoints<?> pendingWithDown) |
static ConsistencyLevel |
fromCode(int code) |
boolean |
isDatacenterLocal() |
boolean |
isSerialConsistency() |
static int |
localQuorumFor(AbstractReplicationStrategy replicationStrategy,
java.lang.String dc) |
static int |
localQuorumForOurDc(AbstractReplicationStrategy replicationStrategy) |
static int |
quorumFor(AbstractReplicationStrategy replicationStrategy) |
boolean |
satisfies(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.
|
void |
validateCounterForWrite(TableMetadata metadata) |
void |
validateForCas() |
void |
validateForCasCommit(AbstractReplicationStrategy replicationStrategy) |
void |
validateForRead() |
void |
validateForWrite() |
static ConsistencyLevel |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ConsistencyLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConsistencyLevel ANY
public static final ConsistencyLevel ONE
public static final ConsistencyLevel TWO
public static final ConsistencyLevel THREE
public static final ConsistencyLevel QUORUM
public static final ConsistencyLevel ALL
public static final ConsistencyLevel LOCAL_QUORUM
public static final ConsistencyLevel EACH_QUORUM
public static final ConsistencyLevel SERIAL
public static final ConsistencyLevel LOCAL_SERIAL
public static final ConsistencyLevel LOCAL_ONE
public static final ConsistencyLevel NODE_LOCAL
public static ConsistencyLevel[] values()
for (ConsistencyLevel c : ConsistencyLevel.values()) System.out.println(c);
public static ConsistencyLevel valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static ConsistencyLevel fromCode(int code)
public static int quorumFor(AbstractReplicationStrategy replicationStrategy)
public static int localQuorumFor(AbstractReplicationStrategy replicationStrategy, java.lang.String dc)
public static int localQuorumForOurDc(AbstractReplicationStrategy replicationStrategy)
public static com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> eachQuorumForRead(AbstractReplicationStrategy replicationStrategy)
public static com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> eachQuorumForWrite(AbstractReplicationStrategy replicationStrategy, Endpoints<?> pendingWithDown)
public int blockFor(AbstractReplicationStrategy replicationStrategy)
public int blockForWrite(AbstractReplicationStrategy replicationStrategy, Endpoints<?> pending)
public boolean satisfies(ConsistencyLevel other, AbstractReplicationStrategy replicationStrategy)
public boolean isDatacenterLocal()
public void validateForRead() throws InvalidRequestException
InvalidRequestException
public void validateForWrite() throws InvalidRequestException
InvalidRequestException
public void validateForCasCommit(AbstractReplicationStrategy replicationStrategy) throws InvalidRequestException
InvalidRequestException
public void validateForCas() throws InvalidRequestException
InvalidRequestException
public boolean isSerialConsistency()
public void validateCounterForWrite(TableMetadata metadata) throws InvalidRequestException
InvalidRequestException
Copyright © 2009- The Apache Software Foundation