public abstract class ModificationStatement extends java.lang.Object implements CQLStatement, MeasurableForPreparedCache
Modifier and Type | Class and Description |
---|---|
static class |
ModificationStatement.Parsed |
static class |
ModificationStatement.StatementType |
Modifier and Type | Field and Description |
---|---|
Attributes |
attrs |
CFMetaData |
cfm |
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 |
addKeyValue(ColumnDefinition def,
Term value) |
void |
addOperation(Operation op) |
abstract void |
addUpdateForKey(ColumnFamily updates,
java.nio.ByteBuffer key,
Composite prefix,
UpdateParameters params) |
void |
addUpdatesAndConditions(java.nio.ByteBuffer key,
Composite clusteringPrefix,
ColumnFamily updates,
CQL3CasConditions conditions,
QueryOptions options,
long now) |
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)
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 |
getBoundTerms()
Returns the number of bound terms in this statement.
|
java.lang.Iterable<ColumnDefinition> |
getColumnsWithConditions() |
protected ColumnDefinition |
getFirstEmptyKey() |
java.util.List<Operation> |
getOperations() |
long |
getTimestamp(long now,
QueryOptions options) |
int |
getTimeToLive(QueryOptions options) |
boolean |
hasConditions() |
boolean |
hasIfExistCondition() |
boolean |
hasIfNotExistCondition() |
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) |
long |
measureForPreparedCache(org.github.jamm.MemoryMeter meter) |
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) |
protected java.util.Map<java.nio.ByteBuffer,CQL3Row> |
readRows(java.util.Collection<java.nio.ByteBuffer> partitionKeys,
Composite rowPrefix,
CFMetaData cfm,
boolean local,
ConsistencyLevel cl) |
abstract boolean |
requireFullClusteringKey() |
void |
setIfExistCondition() |
void |
setIfNotExistCondition() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
public final ModificationStatement.StatementType type
public final CFMetaData cfm
public final Attributes attrs
public ModificationStatement(ModificationStatement.StatementType type, int boundTerms, CFMetaData cfm, Attributes attrs)
public long measureForPreparedCache(org.github.jamm.MemoryMeter meter)
measureForPreparedCache
in interface MeasurableForPreparedCache
public abstract boolean requireFullClusteringKey()
public abstract void addUpdateForKey(ColumnFamily updates, java.nio.ByteBuffer key, Composite prefix, UpdateParameters params) throws InvalidRequestException
InvalidRequestException
public int getBoundTerms()
CQLStatement
getBoundTerms
in interface CQLStatement
public java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public long getTimestamp(long now, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public boolean isTimestampSet()
public int getTimeToLive(QueryOptions options) 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 java.lang.Iterable<ColumnDefinition> getColumnsWithConditions()
public void addCondition(ColumnCondition cond) throws InvalidRequestException
InvalidRequestException
public void setIfNotExistCondition()
public boolean hasIfNotExistCondition()
public void setIfExistCondition()
public boolean hasIfExistCondition()
public void addKeyValue(ColumnDefinition def, 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(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public Composite createClusteringPrefix(QueryOptions options) throws InvalidRequestException
InvalidRequestException
protected ColumnDefinition getFirstEmptyKey()
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
protected java.util.Map<java.nio.ByteBuffer,CQL3Row> readRows(java.util.Collection<java.nio.ByteBuffer> partitionKeys, Composite rowPrefix, CFMetaData cfm, 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 void addUpdatesAndConditions(java.nio.ByteBuffer key, Composite clusteringPrefix, ColumnFamily updates, CQL3CasConditions conditions, QueryOptions options, long now) throws InvalidRequestException
InvalidRequestException
public 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
InvalidRequestException
public ResultMessage executeInternal(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatement
executeInternal
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public UpdateParameters makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys, Composite prefix, QueryOptions options, boolean local, long now) throws RequestExecutionException, RequestValidationException
Copyright © 2014 The Apache Software Foundation