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 DecoratedKey
key
TableMetadata
metadata
-
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 void
addConditions(Clustering<?> clustering, java.util.Collection<ColumnCondition> conds, QueryOptions options)
void
addExist(Clustering<?> clustering)
void
addNotExist(Clustering<?> clustering)
boolean
appliesTo(FilteredPartition current)
Checks whether the conditions represented by this object applies provided the current state of the partition on which those conditions are.PartitionUpdate
makeUpdates(FilteredPartition current, ClientState clientState, Ballot ballot)
The updates to perform of a CAS success.SinglePartitionReadCommand
readCommand(long nowInSec)
The command to use to fetch the value to compare for the CAS.java.lang.String
toString()
-
-
-
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(long nowInSec)
Description copied from interface:CASRequest
The command to use to fetch the value to compare for the CAS.- Specified by:
readCommand
in 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:
appliesTo
in 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:CASRequest
The updates to perform of a CAS success. The values fetched using the readFilter() are passed as argument.- Specified by:
makeUpdates
in interfaceCASRequest
- Throws:
InvalidRequestException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-