public abstract class ModificationStatement extends CFStatement implements CQLStatement
Modifier and Type | Class and Description |
---|---|
static class |
ModificationStatement.Type |
ParsedStatement.Prepared
Modifier and Type | Field and Description |
---|---|
protected ModificationStatement.Type |
type |
cfName
Constructor and Description |
---|
ModificationStatement(CFName name,
Attributes attrs) |
ModificationStatement(CFName name,
java.lang.Long timestamp,
int timeToLive) |
Modifier and Type | Method and Description |
---|---|
void |
checkAccess(ClientState state)
Perform any access verification necessary for the statement.
|
ResultMessage |
execute(ConsistencyLevel cl,
QueryState queryState,
java.util.List<java.nio.ByteBuffer> variables)
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.
|
protected abstract java.util.Collection<? extends IMutation> |
getMutations(java.util.List<java.nio.ByteBuffer> variables,
boolean local,
ConsistencyLevel cl,
long now)
Convert statement into a list of mutations to apply on the server
|
long |
getTimestamp(long now) |
int |
getTimeToLive() |
boolean |
isSetTimestamp() |
abstract ParsedStatement.Prepared |
prepare(ColumnSpecification[] boundNames) |
protected java.util.Map<java.nio.ByteBuffer,ColumnGroupMap> |
readRows(java.util.List<java.nio.ByteBuffer> keys,
ColumnNameBuilder builder,
java.util.Set<java.nio.ByteBuffer> toRead,
CompositeType composite,
boolean local,
ConsistencyLevel cl) |
void |
setTimestamp(long timestamp) |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
protected abstract void |
validateConsistency(ConsistencyLevel cl) |
columnFamily, keyspace, prepareKeyspace
getBoundsTerms, prepare, setBoundTerms
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBoundsTerms
protected ModificationStatement.Type type
public ModificationStatement(CFName name, Attributes attrs)
public ModificationStatement(CFName name, java.lang.Long timestamp, int timeToLive)
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
protected abstract void validateConsistency(ConsistencyLevel cl) throws InvalidRequestException
InvalidRequestException
public ResultMessage execute(ConsistencyLevel cl, QueryState queryState, java.util.List<java.nio.ByteBuffer> variables) throws RequestExecutionException, RequestValidationException
CQLStatement
execute
in interface CQLStatement
queryState
- the current query statevariables
- the values for bounded variables. The implementation
can assume that each bound term have a corresponding value.RequestExecutionException
RequestValidationException
public ResultMessage executeInternal(QueryState queryState) throws RequestValidationException, RequestExecutionException
CQLStatement
executeInternal
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public long getTimestamp(long now)
public void setTimestamp(long timestamp)
public boolean isSetTimestamp()
public int getTimeToLive()
protected java.util.Map<java.nio.ByteBuffer,ColumnGroupMap> readRows(java.util.List<java.nio.ByteBuffer> keys, ColumnNameBuilder builder, java.util.Set<java.nio.ByteBuffer> toRead, CompositeType composite, boolean local, ConsistencyLevel cl) throws RequestExecutionException, RequestValidationException
protected abstract java.util.Collection<? extends IMutation> getMutations(java.util.List<java.nio.ByteBuffer> variables, boolean local, ConsistencyLevel cl, long now) 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
public abstract ParsedStatement.Prepared prepare(ColumnSpecification[] boundNames) throws InvalidRequestException
InvalidRequestException
Copyright © 2013 The Apache Software Foundation