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(ConsistencyLevel cl,
QueryState queryState,
java.util.List<java.nio.ByteBuffer> variables,
int pageSize,
PagingState pagingState)
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(ConsistencyLevel cl,
QueryState queryState,
java.util.List<java.nio.ByteBuffer> variables) |
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
InvalidRequestException
public int getBoundsTerms()
CQLStatement
getBoundsTerms
in interface CQLStatement
public 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
InvalidRequestException
public boolean isTimestampSet()
public int getTimeToLive(java.util.List<java.nio.ByteBuffer> variables) 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 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
InvalidRequestException
public void processWhereClause(java.util.List<Relation> whereClause, ColumnSpecification[] names) throws InvalidRequestException
InvalidRequestException
protected 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(ConsistencyLevel cl, QueryState queryState, java.util.List<java.nio.ByteBuffer> variables, int pageSize, PagingState pagingState) throws RequestExecutionException, RequestValidationException
CQLStatement
execute
in interface CQLStatement
cl
- the consistency level for the queryqueryState
- the current query statevariables
- the values for bounded variables. The implementation
can assume that each bound term have a corresponding value.pageSize
- the initial page size for the result set potentially returned. A negative value
means no paging needs to be done. Statements that do not return result sets can ignore this value.pagingState
- the paging state for paged query. All statement except Select should ignore
that value.RequestExecutionException
RequestValidationException
public ResultMessage executeWithCondition(ConsistencyLevel cl, QueryState queryState, java.util.List<java.nio.ByteBuffer> variables) throws RequestExecutionException, RequestValidationException
public ResultMessage executeInternal(QueryState queryState) throws RequestValidationException, RequestExecutionException
CQLStatement
executeInternal
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public 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 requestsRequestExecutionException
RequestValidationException
Copyright © 2013 The Apache Software Foundation