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() |
boolean |
requiresRead() |
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 MeasurableForPreparedCachepublic abstract boolean requireFullClusteringKey()
public abstract void addUpdateForKey(ColumnFamily updates, java.nio.ByteBuffer key, Composite prefix, UpdateParameters params) throws InvalidRequestException
InvalidRequestExceptionpublic int getBoundTerms()
CQLStatementgetBoundTerms in interface CQLStatementpublic java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public long getTimestamp(long now,
QueryOptions options)
throws InvalidRequestException
InvalidRequestExceptionpublic boolean isTimestampSet()
public int getTimeToLive(QueryOptions options) 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 java.lang.Iterable<ColumnDefinition> getColumnsWithConditions()
public void addCondition(ColumnCondition cond) throws InvalidRequestException
InvalidRequestExceptionpublic void setIfNotExistCondition()
public boolean hasIfNotExistCondition()
public void setIfExistCondition()
public boolean hasIfExistCondition()
public void addKeyValue(ColumnDefinition def, Term value) throws InvalidRequestException
InvalidRequestExceptionpublic void processWhereClause(java.util.List<Relation> whereClause, VariableSpecifications names) throws InvalidRequestException
InvalidRequestExceptionpublic java.util.List<java.nio.ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic Composite createClusteringPrefix(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionprotected ColumnDefinition getFirstEmptyKey()
public boolean requiresRead()
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
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 void addUpdatesAndConditions(java.nio.ByteBuffer key,
Composite clusteringPrefix,
ColumnFamily updates,
CQL3CasConditions conditions,
QueryOptions options,
long now)
throws InvalidRequestException
InvalidRequestExceptionpublic 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
InvalidRequestExceptionpublic ResultMessage executeInternal(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatementexecuteInternal in interface CQLStatementqueryState - the current query stateRequestValidationExceptionRequestExecutionExceptionpublic 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