public abstract class ModificationStatement extends java.lang.Object implements CQLStatement
Modifier and Type | Class and Description |
---|---|
static class |
ModificationStatement.Parsed |
Modifier and Type | Field and Description |
---|---|
CFMetaData |
cfm |
static java.lang.String |
CUSTOM_EXPRESSIONS_NOT_ALLOWED |
protected static org.slf4j.Logger |
logger |
protected StatementType |
type |
Constructor and Description |
---|
ModificationStatement(StatementType type,
int boundTerms,
CFMetaData cfm,
Operations operations,
StatementRestrictions restrictions,
Conditions conditions,
Attributes attrs) |
Modifier and Type | Method and Description |
---|---|
void |
addConditions(Clustering clustering,
CQL3CasRequest request,
QueryOptions options) |
void |
addFunctionsTo(java.util.List<Function> functions) |
abstract void |
addUpdateForKey(PartitionUpdate update,
Clustering clustering,
UpdateParameters params) |
abstract void |
addUpdateForKey(PartitionUpdate update,
Slice slice,
UpdateParameters params) |
java.lang.Iterable<Operation> |
allOperations() |
static boolean |
appliesOnlyToStaticColumns(Operations operation,
Conditions conditions)
Checks that the specified operations and conditions only apply to static columns.
|
static ResultSet |
buildCasResultSet(java.lang.String ksName,
java.lang.String tableName,
RowIterator partition,
java.lang.Iterable<ColumnDefinition> columnsWithConditions,
boolean isBatch,
QueryOptions options) |
java.util.List<java.nio.ByteBuffer> |
buildPartitionKeyNames(QueryOptions options) |
void |
checkAccess(ClientState state)
Perform any access verification necessary for the statement.
|
java.lang.String |
columnFamily() |
PartitionColumns |
conditionColumns() |
java.util.NavigableSet<Clustering> |
createClustering(QueryOptions options) |
ResultMessage |
execute(QueryState queryState,
QueryOptions options)
Execute the statement and return the resulting result or null if there is no result.
|
ResultMessage |
executeInternal(QueryState queryState,
QueryOptions options)
Variant of execute used for internal query against the system tables, and thus only query the local node.
|
ResultMessage |
executeInternalWithCondition(QueryState state,
QueryOptions options) |
ResultMessage |
executeInternalWithoutCondition(QueryState queryState,
QueryOptions options) |
ResultMessage |
executeWithCondition(QueryState queryState,
QueryOptions options) |
int |
getBoundTerms()
Returns the number of bound terms in this statement.
|
java.lang.Iterable<ColumnDefinition> |
getColumnsWithConditions() |
java.lang.Iterable<Function> |
getFunctions()
Return an Iterable over all of the functions (both native and user-defined) used by any component
of the statement
|
java.util.List<Operation> |
getRegularOperations() |
StatementRestrictions |
getRestrictions() |
java.util.List<Operation> |
getStaticOperations() |
long |
getTimestamp(long now,
QueryOptions options) |
int |
getTimeToLive(QueryOptions options) |
boolean |
hasConditions() |
boolean |
hasIfExistCondition() |
boolean |
hasIfNotExistCondition() |
boolean |
hasSlices() |
boolean |
isCounter() |
boolean |
isTimestampSet() |
boolean |
isView() |
java.lang.String |
keyspace() |
boolean |
requiresRead() |
PartitionColumns |
updatedColumns() |
boolean |
updatesRegularRows() |
boolean |
updatesStaticRow() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
protected static final org.slf4j.Logger logger
public static final java.lang.String CUSTOM_EXPRESSIONS_NOT_ALLOWED
protected final StatementType type
public final CFMetaData cfm
public ModificationStatement(StatementType type, int boundTerms, CFMetaData cfm, Operations operations, StatementRestrictions restrictions, Conditions conditions, Attributes attrs)
public StatementRestrictions getRestrictions()
public java.lang.Iterable<Function> getFunctions()
CQLStatement
getFunctions
in interface CQLStatement
public void addFunctionsTo(java.util.List<Function> functions)
public abstract void addUpdateForKey(PartitionUpdate update, Clustering clustering, UpdateParameters params)
public abstract void addUpdateForKey(PartitionUpdate update, Slice slice, UpdateParameters params)
public int getBoundTerms()
CQLStatement
getBoundTerms
in interface CQLStatement
public java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public boolean isView()
public long getTimestamp(long now, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public boolean isTimestampSet()
public int getTimeToLive(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
CQLStatement
checkAccess
in interface CQLStatement
state
- the current client stateInvalidRequestException
UnauthorizedException
public void validate(ClientState state) throws InvalidRequestException
CQLStatement
validate
in interface CQLStatement
state
- the current client stateInvalidRequestException
public PartitionColumns updatedColumns()
public PartitionColumns conditionColumns()
public boolean updatesRegularRows()
public boolean updatesStaticRow()
public java.util.List<Operation> getRegularOperations()
public java.util.List<Operation> getStaticOperations()
public java.lang.Iterable<Operation> allOperations()
public java.lang.Iterable<ColumnDefinition> getColumnsWithConditions()
public boolean hasIfNotExistCondition()
public boolean hasIfExistCondition()
public java.util.List<java.nio.ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public java.util.NavigableSet<Clustering> createClustering(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public static boolean appliesOnlyToStaticColumns(Operations operation, Conditions conditions)
true
if the specified operations and conditions only apply to static columns,
false
otherwise.public boolean requiresRead()
public boolean hasConditions()
public boolean hasSlices()
public ResultMessage execute(QueryState queryState, QueryOptions options) throws RequestExecutionException, RequestValidationException
CQLStatement
execute
in interface CQLStatement
queryState
- the current query stateoptions
- options for this query (consistency, variables, pageSize, ...)RequestExecutionException
RequestValidationException
public ResultMessage executeWithCondition(QueryState queryState, QueryOptions options) throws RequestExecutionException, RequestValidationException
public void addConditions(Clustering clustering, CQL3CasRequest request, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public static ResultSet buildCasResultSet(java.lang.String ksName, java.lang.String tableName, RowIterator partition, java.lang.Iterable<ColumnDefinition> columnsWithConditions, boolean isBatch, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public ResultMessage executeInternal(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatement
executeInternal
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
public ResultMessage executeInternalWithCondition(QueryState state, QueryOptions options) throws RequestValidationException, RequestExecutionException
Copyright © 2009- The Apache Software Foundation