public abstract class ModificationStatement extends java.lang.Object implements CQLStatement, MeasurableForPreparedCache
Modifier and Type | Class and Description |
---|---|
static class |
ModificationStatement.Parsed |
Modifier and Type | Field and Description |
---|---|
Attributes |
attrs |
CFMetaData |
cfm |
Constructor and Description |
---|
ModificationStatement(CFMetaData cfm,
Attributes attrs) |
Modifier and Type | Method and Description |
---|---|
void |
addCondition(Operation op) |
void |
addKeyValue(ColumnIdentifier name,
Term value) |
void |
addOperation(Operation op) |
java.util.List<java.nio.ByteBuffer> |
buildPartitionKeyNames(java.util.List<java.nio.ByteBuffer> variables) |
void |
checkAccess(ClientState state)
Perform any access verification necessary for the statement.
|
java.lang.String |
columnFamily() |
ColumnNameBuilder |
createClusteringPrefixBuilder(java.util.List<java.nio.ByteBuffer> variables) |
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() |
long |
measureForPreparedCache(org.github.jamm.MemoryMeter meter) |
void |
processWhereClause(java.util.List<Relation> whereClause,
VariableSpecifications names) |
protected java.util.Map<java.nio.ByteBuffer,ColumnGroupMap> |
readRequiredRows(java.util.List<java.nio.ByteBuffer> partitionKeys,
ColumnNameBuilder clusteringPrefix,
boolean local,
ConsistencyLevel cl) |
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 final Attributes attrs
public ModificationStatement(CFMetaData cfm, Attributes attrs)
public long measureForPreparedCache(org.github.jamm.MemoryMeter meter)
measureForPreparedCache
in interface MeasurableForPreparedCache
public 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, VariableSpecifications names) throws InvalidRequestException
InvalidRequestException
public java.util.List<java.nio.ByteBuffer> buildPartitionKeyNames(java.util.List<java.nio.ByteBuffer> variables) throws InvalidRequestException
InvalidRequestException
public ColumnNameBuilder createClusteringPrefixBuilder(java.util.List<java.nio.ByteBuffer> variables) 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(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 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