Package org.apache.cassandra.cql3
Class Operation
- java.lang.Object
-
- org.apache.cassandra.cql3.Operation
-
- Direct Known Subclasses:
Constants.Adder,Constants.Deleter,Constants.Setter,Constants.Substracter,Lists.Appender,Lists.Discarder,Lists.DiscarderByIndex,Lists.Prepender,Lists.Setter,Lists.SetterByIndex,Maps.DiscarderByKey,Maps.Putter,Maps.Setter,Maps.SetterByKey,Sets.Adder,Sets.Discarder,Sets.ElementDiscarder,Sets.Setter,UserTypes.DeleterByField,UserTypes.Setter,UserTypes.SetterByField
public abstract class Operation extends java.lang.ObjectAn UPDATE or DELETE operation. For UPDATE this includes: - setting a constant - counter operations - collections operations and for DELETE: - deleting a column - deleting an element of collection column Fine grained operation are obtained from their raw counterpart (Operation.Raw, which correspond to a parsed, non-checked operation) by provided the receiver for the operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOperation.Additionstatic classOperation.ColumnDeletionstatic classOperation.ElementDeletionstatic classOperation.FieldDeletionstatic classOperation.Prependstatic interfaceOperation.RawDeletionA parsed raw DELETE operation.static interfaceOperation.RawUpdateA parsed raw UPDATE operation.static classOperation.SetElementstatic classOperation.SetFieldstatic classOperation.SetValuestatic classOperation.Substraction
-
Field Summary
Fields Modifier and Type Field Description ColumnMetadatacolumnprotected Termt
-
Constructor Summary
Constructors Modifier Constructor Description protectedOperation(ColumnMetadata column, Term t)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddFunctionsTo(java.util.List<Function> functions)voidcollectMarkerSpecification(VariableSpecifications boundNames)Collects the column specification for the bind variables of this operation.abstract voidexecute(DecoratedKey partitionKey, UpdateParameters params)Execute the operation.booleanrequiresRead()
-
-
-
Field Detail
-
column
public final ColumnMetadata column
-
t
protected final Term t
-
-
Constructor Detail
-
Operation
protected Operation(ColumnMetadata column, Term t)
-
-
Method Detail
-
addFunctionsTo
public void addFunctionsTo(java.util.List<Function> functions)
-
requiresRead
public boolean requiresRead()
- Returns:
- whether the operation requires a read of the previous value to be executed (only lists setterByIdx, discard and discardByIdx requires that).
-
collectMarkerSpecification
public void collectMarkerSpecification(VariableSpecifications boundNames)
Collects the column specification for the bind variables of this operation.- Parameters:
boundNames- the list of column specification where to collect the bind variables of this term in.
-
execute
public abstract void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException
Execute the operation.- Parameters:
partitionKey- partition key for the update.params- parameters of the update.- Throws:
InvalidRequestException
-
-