public abstract class ModificationStatement extends java.lang.Object implements CQLStatement
| Modifier and Type | Class and Description |
|---|---|
static class |
ModificationStatement.Parsed |
static class |
ModificationStatement.StatementType |
| Modifier and Type | Field and Description |
|---|---|
Attributes |
attrs |
CFMetaData |
cfm |
protected java.util.Map<ColumnIdentifier,Restriction> |
processedKeys |
ModificationStatement.StatementType |
type |
| Constructor and Description |
|---|
ModificationStatement(ModificationStatement.StatementType type,
int boundTerms,
CFMetaData cfm,
Attributes attrs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCondition(ColumnCondition cond) |
void |
addConditions(Composite clusteringPrefix,
CQL3CasRequest request,
QueryOptions options) |
void |
addKeyValue(ColumnDefinition def,
Term value) |
void |
addOperation(Operation op) |
abstract void |
addUpdateForKey(ColumnFamily updates,
java.nio.ByteBuffer key,
Composite prefix,
UpdateParameters params) |
protected boolean |
appliesOnlyToStaticColumns()
Checks that the modification only apply to static columns.
|
protected boolean |
appliesToRegularColumns()
Checks that the modification apply to regular columns.
|
static ResultSet |
buildCasResultSet(java.lang.String ksName,
java.nio.ByteBuffer key,
java.lang.String cfName,
ColumnFamily cf,
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() |
Composite |
createClusteringPrefix(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() |
protected ColumnDefinition |
getFirstEmptyKey() |
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> |
getOperations() |
long |
getTimestamp(long now,
QueryOptions options) |
int |
getTimeToLive(QueryOptions options) |
boolean |
hasConditions() |
boolean |
hasIfExistCondition() |
boolean |
hasIfNotExistCondition() |
boolean |
hasRegularConditions() |
boolean |
hasStaticConditions() |
boolean |
isCounter() |
boolean |
isTimestampSet() |
java.lang.String |
keyspace() |
UpdateParameters |
makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys,
Composite prefix,
QueryOptions options,
boolean local,
long now) |
void |
processWhereClause(java.util.List<Relation> whereClause,
VariableSpecifications names) |
protected java.util.Map<java.nio.ByteBuffer,CQL3Row> |
readRequiredRows(java.util.Collection<java.nio.ByteBuffer> partitionKeys,
Composite clusteringPrefix,
boolean local,
ConsistencyLevel cl) |
abstract boolean |
requireFullClusteringKey() |
boolean |
requiresRead() |
void |
setIfExistCondition() |
void |
setIfNotExistCondition() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
protected void |
validateWhereClauseForConditions()
If there are conditions on the statement, this is called after the where clause and conditions have been
processed to check that they are compatible.
|
public final ModificationStatement.StatementType type
public final CFMetaData cfm
public final Attributes attrs
protected final java.util.Map<ColumnIdentifier,Restriction> processedKeys
public ModificationStatement(ModificationStatement.StatementType type, int boundTerms, CFMetaData cfm, Attributes attrs)
public java.lang.Iterable<Function> getFunctions()
CQLStatementgetFunctions in interface CQLStatementpublic abstract boolean requireFullClusteringKey()
public abstract void addUpdateForKey(ColumnFamily updates, java.nio.ByteBuffer key, Composite prefix, UpdateParameters params) throws InvalidRequestException
InvalidRequestExceptionpublic int getBoundTerms()
CQLStatementgetBoundTerms in interface CQLStatementpublic java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public long getTimestamp(long now,
QueryOptions options)
throws InvalidRequestException
InvalidRequestExceptionpublic boolean isTimestampSet()
public int getTimeToLive(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
CQLStatementcheckAccess in interface CQLStatementstate - the current client stateInvalidRequestExceptionUnauthorizedExceptionpublic void validate(ClientState state) throws InvalidRequestException
CQLStatementvalidate in interface CQLStatementstate - the current client stateInvalidRequestExceptionpublic void addOperation(Operation op)
public java.util.List<Operation> getOperations()
public java.lang.Iterable<ColumnDefinition> getColumnsWithConditions()
public void addCondition(ColumnCondition cond)
public void setIfNotExistCondition()
public boolean hasIfNotExistCondition()
public void setIfExistCondition()
public boolean hasIfExistCondition()
public boolean hasStaticConditions()
public boolean hasRegularConditions()
public void addKeyValue(ColumnDefinition def, Term value) throws InvalidRequestException
InvalidRequestExceptionpublic void processWhereClause(java.util.List<Relation> whereClause, VariableSpecifications names) throws InvalidRequestException
InvalidRequestExceptionpublic java.util.List<java.nio.ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic Composite createClusteringPrefix(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionprotected boolean appliesOnlyToStaticColumns()
true if the modification only apply to static columns, false otherwise.protected boolean appliesToRegularColumns()
true if the modification apply to regular columns, false otherwise.protected ColumnDefinition getFirstEmptyKey()
public boolean requiresRead()
protected java.util.Map<java.nio.ByteBuffer,CQL3Row> readRequiredRows(java.util.Collection<java.nio.ByteBuffer> partitionKeys, Composite clusteringPrefix, boolean local, ConsistencyLevel cl) throws RequestExecutionException, RequestValidationException
public boolean hasConditions()
public ResultMessage execute(QueryState queryState, QueryOptions options) throws RequestExecutionException, RequestValidationException
CQLStatementexecute in interface CQLStatementqueryState - the current query stateoptions - options for this query (consistency, variables, pageSize, ...)RequestExecutionExceptionRequestValidationExceptionpublic ResultMessage executeWithCondition(QueryState queryState, QueryOptions options) throws RequestExecutionException, RequestValidationException
public void addConditions(Composite clusteringPrefix, CQL3CasRequest request, QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic static ResultSet buildCasResultSet(java.lang.String ksName, java.nio.ByteBuffer key, java.lang.String cfName, ColumnFamily cf, java.lang.Iterable<ColumnDefinition> columnsWithConditions, boolean isBatch, QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic ResultMessage executeInternal(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatementexecuteInternal in interface CQLStatementqueryState - the current query stateRequestValidationExceptionRequestExecutionExceptionpublic ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
public ResultMessage executeInternalWithCondition(QueryState state, QueryOptions options) throws RequestValidationException, RequestExecutionException
public UpdateParameters makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys, Composite prefix, QueryOptions options, boolean local, long now) throws RequestExecutionException, RequestValidationException
protected void validateWhereClauseForConditions()
throws InvalidRequestException
InvalidRequestExceptionCopyright © 2018 The Apache Software Foundation