Package com.datastax.oss.driver.api.core
Interface ConsistencyLevel
-
- All Known Implementing Classes:
DefaultConsistencyLevel
public interface ConsistencyLevelThe consistency level of a request.The only reason to model this as an interface (as opposed to an enum type) is to accommodate for custom protocol extensions. If you're connecting to a standard Apache Cassandra cluster, all
ConsistencyLevels areDefaultConsistencyLevelinstances.
-
-
Field Summary
Fields Modifier and Type Field Description static ConsistencyLevelALLstatic ConsistencyLevelANYstatic ConsistencyLevelEACH_QUORUMstatic ConsistencyLevelLOCAL_ONEstatic ConsistencyLevelLOCAL_QUORUMstatic ConsistencyLevelLOCAL_SERIALstatic ConsistencyLevelONEstatic ConsistencyLevelQUORUMstatic ConsistencyLevelSERIALstatic ConsistencyLevelTHREEstatic ConsistencyLevelTWO
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetProtocolCode()The numerical value that the level is encoded to in protocol frames.booleanisDcLocal()Whether this consistency level applies to the local datacenter only.booleanisSerial()Whether this consistency level is serial, that is, applies only to the "paxos" phase of a lightweight transaction.Stringname()The textual representation of the level in configuration files.
-
-
-
Field Detail
-
ANY
static final ConsistencyLevel ANY
-
ONE
static final ConsistencyLevel ONE
-
TWO
static final ConsistencyLevel TWO
-
THREE
static final ConsistencyLevel THREE
-
QUORUM
static final ConsistencyLevel QUORUM
-
ALL
static final ConsistencyLevel ALL
-
LOCAL_ONE
static final ConsistencyLevel LOCAL_ONE
-
LOCAL_QUORUM
static final ConsistencyLevel LOCAL_QUORUM
-
EACH_QUORUM
static final ConsistencyLevel EACH_QUORUM
-
SERIAL
static final ConsistencyLevel SERIAL
-
LOCAL_SERIAL
static final ConsistencyLevel LOCAL_SERIAL
-
-
Method Detail
-
getProtocolCode
int getProtocolCode()
The numerical value that the level is encoded to in protocol frames.
-
name
@NonNull String name()
The textual representation of the level in configuration files.
-
isDcLocal
boolean isDcLocal()
Whether this consistency level applies to the local datacenter only.
-
isSerial
boolean isSerial()
Whether this consistency level is serial, that is, applies only to the "paxos" phase of a lightweight transaction.Serial consistency levels are only meaningful when executing conditional updates (
INSERT,UPDATEorDELETEstatements with anIFcondition).
-
-