Class CQL3CasRequest
- java.lang.Object
-
- org.apache.cassandra.cql3.statements.CQL3CasRequest
-
- All Implemented Interfaces:
CASRequest
public class CQL3CasRequest extends java.lang.Object implements CASRequest
Processed CAS conditions and update on potentially multiple rows of the same partition.
-
-
Field Summary
Fields Modifier and Type Field Description DecoratedKeykeyTableMetadatametadata
-
Constructor Summary
Constructors Constructor Description CQL3CasRequest(TableMetadata metadata, DecoratedKey key, RegularAndStaticColumns conditionColumns, boolean updatesRegularRows, boolean updatesStaticRow)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConditions(Clustering<?> clustering, java.util.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.PartitionUpdatemakeUpdates(FilteredPartition current, ClientState clientState, Ballot ballot)The updates to perform of a CAS success.SinglePartitionReadCommandreadCommand(int nowInSec)The command to use to fetch the value to compare for the CAS.java.lang.StringtoString()
-
-
-
Field Detail
-
metadata
public final TableMetadata metadata
-
key
public final DecoratedKey key
-
-
Constructor Detail
-
CQL3CasRequest
public CQL3CasRequest(TableMetadata metadata, DecoratedKey key, RegularAndStaticColumns conditionColumns, boolean updatesRegularRows, boolean updatesStaticRow)
-
-
Method Detail
-
addNotExist
public void addNotExist(Clustering<?> clustering) throws InvalidRequestException
- Throws:
InvalidRequestException
-
addExist
public void addExist(Clustering<?> clustering) throws InvalidRequestException
- Throws:
InvalidRequestException
-
addConditions
public void addConditions(Clustering<?> clustering, java.util.Collection<ColumnCondition> conds, QueryOptions options) throws InvalidRequestException
- Throws:
InvalidRequestException
-
readCommand
public SinglePartitionReadCommand readCommand(int nowInSec)
Description copied from interface:CASRequestThe command to use to fetch the value to compare for the CAS.- Specified by:
readCommandin interfaceCASRequest
-
appliesTo
public boolean appliesTo(FilteredPartition current) throws InvalidRequestException
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(int). 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-