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 |
| Constructor and Description |
|---|
ModificationStatement(int boundTerms,
CFMetaData cfm,
Attributes attrs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCondition(Operation op) |
void |
addKeyValue(ColumnIdentifier name,
Term value) |
void |
addOperation(Operation op) |
void |
checkAccess(ClientState state)
Perform any access verification necessary for the statement.
|
java.lang.String |
columnFamily() |
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)
Variante of execute used for internal query against the system tables, and thus only query the local node.
|
ResultMessage |
executeWithCondition(QueryState queryState,
QueryOptions options) |
int |
getBoundsTerms()
Returns the number of bound terms in this statement.
|
protected CFDefinition.Name |
getFirstEmptyKey() |
java.util.Collection<? extends IMutation> |
getMutations(java.util.List<java.nio.ByteBuffer> variables,
boolean local,
ConsistencyLevel cl,
long now,
boolean isBatch)
Convert statement into a list of mutations to apply on the server
|
java.util.List<Operation> |
getOperations() |
long |
getTimestamp(long now,
java.util.List<java.nio.ByteBuffer> variables) |
int |
getTimeToLive(java.util.List<java.nio.ByteBuffer> variables) |
boolean |
hasConditions() |
boolean |
isCounter() |
boolean |
isTimestampSet() |
java.lang.String |
keyspace() |
void |
processWhereClause(java.util.List<Relation> whereClause,
ColumnSpecification[] names) |
protected java.util.Map<java.nio.ByteBuffer,ColumnGroupMap> |
readRequiredRows(java.util.List<java.nio.ByteBuffer> partitionKeys,
ColumnNameBuilder clusteringPrefix,
boolean local,
ConsistencyLevel cl) |
protected abstract boolean |
requireFullClusteringKey() |
void |
setIfNotExistCondition() |
abstract ColumnFamily |
updateForKey(java.nio.ByteBuffer key,
ColumnNameBuilder builder,
UpdateParameters params) |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
public final CFMetaData cfm
public ModificationStatement(int boundTerms,
CFMetaData cfm,
Attributes attrs)
protected abstract boolean requireFullClusteringKey()
public abstract ColumnFamily updateForKey(java.nio.ByteBuffer key, ColumnNameBuilder builder, UpdateParameters params) throws InvalidRequestException
InvalidRequestExceptionpublic int getBoundsTerms()
CQLStatementgetBoundsTerms in interface CQLStatementpublic java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public long getTimestamp(long now,
java.util.List<java.nio.ByteBuffer> variables)
throws InvalidRequestException
InvalidRequestExceptionpublic boolean isTimestampSet()
public int getTimeToLive(java.util.List<java.nio.ByteBuffer> variables)
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 void addCondition(Operation op)
public void setIfNotExistCondition()
public void addKeyValue(ColumnIdentifier name, Term value) throws InvalidRequestException
InvalidRequestExceptionpublic void processWhereClause(java.util.List<Relation> whereClause, ColumnSpecification[] names) throws InvalidRequestException
InvalidRequestExceptionprotected CFDefinition.Name getFirstEmptyKey()
protected java.util.Map<java.nio.ByteBuffer,ColumnGroupMap> readRequiredRows(java.util.List<java.nio.ByteBuffer> partitionKeys, ColumnNameBuilder 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 ResultMessage executeInternal(QueryState queryState) throws RequestValidationException, RequestExecutionException
CQLStatementexecuteInternal in interface CQLStatementqueryState - the current query stateRequestValidationExceptionRequestExecutionExceptionpublic java.util.Collection<? extends IMutation> getMutations(java.util.List<java.nio.ByteBuffer> variables, boolean local, ConsistencyLevel cl, long now, boolean isBatch) throws RequestExecutionException, RequestValidationException
variables - value for prepared statement markerslocal - if true, any requests (for collections) performed by getMutation should be done locally only.cl - the consistency to use for the potential reads involved in generating the mutations (for lists set/delete operations)now - the current timestamp in microseconds to use if no timestamp is user provided.InvalidRequestException - on invalid requestsRequestExecutionExceptionRequestValidationExceptionCopyright © 2013 The Apache Software Foundation