public abstract class ModificationStatement extends java.lang.Object implements CQLStatement
| Modifier and Type | Class and Description |
|---|---|
static class |
ModificationStatement.Parsed |
static class |
ModificationStatement.StatementType |
| Modifier and Type | Field and Description |
|---|---|
Attributes |
attrs |
CFMetaData |
cfm |
protected static org.slf4j.Logger |
logger |
protected java.util.Map<ColumnIdentifier,Restriction> |
processedKeys |
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 |
addConditions(Clustering clustering,
CQL3CasRequest request,
QueryOptions options) |
void |
addKeyValue(ColumnDefinition def,
Term value) |
void |
addOperation(Operation op) |
abstract void |
addUpdateForKey(PartitionUpdate update,
CBuilder clusteringBuilder,
UpdateParameters params) |
java.lang.Iterable<ColumnCondition> |
allConditions() |
java.lang.Iterable<Operation> |
allOperations() |
static ResultSet |
buildCasResultSet(java.lang.String ksName,
java.lang.String tableName,
RowIterator partition,
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() |
PartitionColumns |
conditionColumns() |
CBuilder |
createClustering(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)
Variant of execute used for internal query against the system tables, and thus only query the local node.
|
ResultMessage |
executeInternalWithCondition(QueryState state,
QueryOptions options) |
ResultMessage |
executeInternalWithoutCondition(QueryState queryState,
QueryOptions options) |
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.lang.Iterable<Function> |
getFunctions()
Return an Iterable over all of the functions (both native and user-defined) used by any component
of the statement
|
java.util.List<Operation> |
getRegularOperations() |
java.util.List<Operation> |
getStaticOperations() |
long |
getTimestamp(long now,
QueryOptions options) |
int |
getTimeToLive(QueryOptions options) |
boolean |
hasConditions() |
boolean |
hasIfExistCondition() |
boolean |
hasIfNotExistCondition() |
boolean |
hasMaterializedViews() |
boolean |
hasNoClusteringColumns() |
boolean |
isCounter() |
boolean |
isMaterializedView() |
boolean |
isTimestampSet() |
java.lang.String |
keyspace() |
UpdateParameters |
makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys,
CBuilder clustering,
QueryOptions options,
boolean local,
long now) |
void |
processWhereClause(java.util.List<Relation> whereClause,
VariableSpecifications names) |
protected java.util.Map<DecoratedKey,Partition> |
readRequiredLists(java.util.Collection<java.nio.ByteBuffer> partitionKeys,
CBuilder cbuilder,
boolean local,
ConsistencyLevel cl) |
abstract boolean |
requireFullClusteringKey() |
boolean |
requiresRead() |
void |
setIfExistCondition() |
void |
setIfNotExistCondition() |
PartitionColumns |
updatedColumns() |
boolean |
updatesRegularRows() |
boolean |
updatesStaticRow() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
protected void |
validateWhereClauseForConditions()
If there are conditions on the statement, this is called after the where clause and conditions have been
processed to check that they are compatible.
|
protected static final org.slf4j.Logger logger
public final ModificationStatement.StatementType type
public final CFMetaData cfm
public final Attributes attrs
protected final java.util.Map<ColumnIdentifier,Restriction> processedKeys
public ModificationStatement(ModificationStatement.StatementType type, int boundTerms, CFMetaData cfm, Attributes attrs)
public java.lang.Iterable<Function> getFunctions()
CQLStatementgetFunctions in interface CQLStatementpublic boolean hasNoClusteringColumns()
public abstract boolean requireFullClusteringKey()
public abstract void addUpdateForKey(PartitionUpdate update, CBuilder clusteringBuilder, UpdateParameters params) throws InvalidRequestException
InvalidRequestExceptionpublic int getBoundTerms()
CQLStatementgetBoundTerms in interface CQLStatementpublic java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public boolean isMaterializedView()
public boolean hasMaterializedViews()
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 PartitionColumns updatedColumns()
public PartitionColumns conditionColumns()
public boolean updatesRegularRows()
public boolean updatesStaticRow()
public java.util.List<Operation> getRegularOperations()
public java.util.List<Operation> getStaticOperations()
public java.lang.Iterable<Operation> allOperations()
public java.lang.Iterable<ColumnDefinition> getColumnsWithConditions()
public java.lang.Iterable<ColumnCondition> allConditions()
public void addCondition(ColumnCondition cond)
public 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 CBuilder createClustering(QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionprotected ColumnDefinition getFirstEmptyKey()
public boolean requiresRead()
protected java.util.Map<DecoratedKey,Partition> readRequiredLists(java.util.Collection<java.nio.ByteBuffer> partitionKeys, CBuilder cbuilder, 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 addConditions(Clustering clustering, CQL3CasRequest request, QueryOptions options) throws InvalidRequestException
InvalidRequestExceptionpublic static ResultSet buildCasResultSet(java.lang.String ksName, java.lang.String tableName, RowIterator partition, 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 ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
public ResultMessage executeInternalWithCondition(QueryState state, QueryOptions options) throws RequestValidationException, RequestExecutionException
public UpdateParameters makeUpdateParameters(java.util.Collection<java.nio.ByteBuffer> keys, CBuilder clustering, QueryOptions options, boolean local, long now) throws RequestExecutionException, RequestValidationException
protected void validateWhereClauseForConditions()
throws InvalidRequestException
InvalidRequestExceptionCopyright © 2015 The Apache Software Foundation