Class CQL3CasRequest
java.lang.Object
org.apache.cassandra.cql3.statements.CQL3CasRequest
- All Implemented Interfaces:
CASRequest
Processed CAS conditions and update on potentially multiple rows of the same partition.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCQL3CasRequest(TableMetadata metadata, DecoratedKey key, RegularAndStaticColumns conditionColumns, boolean updatesRegularRows, boolean updatesStaticRow) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConditions(Clustering<?> clustering, Collection<ColumnCondition> conds, QueryOptions options) voidaddExist(Clustering<?> clustering) voidaddNotExist(Clustering<?> clustering) booleanappliesTo(FilteredPartition current) Checks whether the conditions represented by this object applies provided the current state of the partition on which those conditions are.makeUpdates(FilteredPartition current, ClientState clientState, Ballot ballot) The updates to perform of a CAS success.readCommand(long nowInSec) The command to use to fetch the value to compare for the CAS.toString()
-
Field Details
-
metadata
-
key
-
-
Constructor Details
-
CQL3CasRequest
public CQL3CasRequest(TableMetadata metadata, DecoratedKey key, RegularAndStaticColumns conditionColumns, boolean updatesRegularRows, boolean updatesStaticRow)
-
-
Method Details
-
addNotExist
- Throws:
InvalidRequestException
-
addExist
- Throws:
InvalidRequestException
-
addConditions
public void addConditions(Clustering<?> clustering, Collection<ColumnCondition> conds, QueryOptions options) throws InvalidRequestException - Throws:
InvalidRequestException
-
readCommand
Description copied from interface:CASRequestThe command to use to fetch the value to compare for the CAS.- Specified by:
readCommandin interfaceCASRequest
-
appliesTo
Checks whether the conditions represented by this object applies provided the current state of the partition on which those conditions are.- Specified by:
appliesToin interfaceCASRequest- Parameters:
current- the partition with current data corresponding to these conditions. More precisely, this must be the result of executing the command returned byreadCommand(long). This can be empty but it should not benull.- Returns:
- whether the conditions represented by this object applies or not.
- Throws:
InvalidRequestException
-
makeUpdates
public PartitionUpdate makeUpdates(FilteredPartition current, ClientState clientState, Ballot ballot) throws InvalidRequestException Description copied from interface:CASRequestThe updates to perform of a CAS success. The values fetched using the readFilter() are passed as argument.- Specified by:
makeUpdatesin interfaceCASRequest- Throws:
InvalidRequestException
-
toString
-