public abstract class ModificationStatement extends java.lang.Object implements CQLStatement
Modifier and Type | Class and Description |
---|---|
static class |
ModificationStatement.Parsed |
CQLStatement.Raw
Modifier and Type | Field and Description |
---|---|
protected VariableSpecifications |
bindVariables |
static java.lang.String |
CUSTOM_EXPRESSIONS_NOT_ALLOWED |
protected static org.slf4j.Logger |
logger |
TableMetadata |
metadata |
protected StatementType |
type |
Constructor and Description |
---|
ModificationStatement(StatementType type,
VariableSpecifications bindVariables,
TableMetadata metadata,
Operations operations,
StatementRestrictions restrictions,
Conditions conditions,
Attributes attrs) |
Modifier and Type | Method and Description |
---|---|
void |
addConditions(Clustering<?> clustering,
CQL3CasRequest request,
QueryOptions options) |
void |
addFunctionsTo(java.util.List<Function> functions) |
abstract void |
addUpdateForKey(PartitionUpdate.Builder updateBuilder,
Clustering<?> clustering,
UpdateParameters params) |
abstract void |
addUpdateForKey(PartitionUpdate.Builder updateBuilder,
Slice slice,
UpdateParameters params) |
java.lang.Iterable<Operation> |
allOperations() |
static boolean |
appliesOnlyToStaticColumns(Operations operation,
Conditions conditions)
Checks that the specified operations and conditions only apply to static columns.
|
void |
authorize(ClientState state)
Perform any access verification necessary for the statement.
|
java.util.List<java.nio.ByteBuffer> |
buildPartitionKeyNames(QueryOptions options) |
java.lang.String |
columnFamily() |
RegularAndStaticColumns |
conditionColumns() |
java.util.NavigableSet<Clustering<?>> |
createClustering(QueryOptions options) |
ResultMessage |
execute(QueryState queryState,
QueryOptions options,
long queryStartNanoTime)
Execute the statement and return the resulting result or null if there is no result.
|
ResultMessage |
executeInternalWithCondition(QueryState state,
QueryOptions options) |
ResultMessage |
executeInternalWithoutCondition(QueryState queryState,
QueryOptions options,
long queryStartNanoTime) |
ResultMessage |
executeLocally(QueryState queryState,
QueryOptions options)
Variant of execute used for internal query against the system tables, and thus only query the local node.
|
java.util.List<ColumnSpecification> |
getBindVariables()
Returns all bind variables for the statement
|
java.lang.Iterable<ColumnMetadata> |
getColumnsWithConditions() |
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
|
short[] |
getPartitionKeyBindVariableIndexes()
Returns an array with the same length as the number of partition key columns for the table corresponding
to table.
|
java.util.List<Operation> |
getRegularOperations() |
StatementRestrictions |
getRestrictions() |
java.util.List<Operation> |
getStaticOperations() |
long |
getTimestamp(long now,
QueryOptions options) |
int |
getTimeToLive(QueryOptions options) |
boolean |
hasConditions()
Whether or not this CQL Statement has LWT conditions
|
boolean |
hasIfExistCondition() |
boolean |
hasIfNotExistCondition() |
boolean |
hasSlices() |
boolean |
isCounter() |
boolean |
isTimestampSet() |
boolean |
isView() |
boolean |
isVirtual() |
java.lang.String |
keyspace() |
TableMetadata |
metadata() |
boolean |
requiresRead() |
RegularAndStaticColumns |
updatedColumns() |
boolean |
updatesRegularRows() |
boolean |
updatesStaticRow() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAuditLogContext
protected static final org.slf4j.Logger logger
public static final java.lang.String CUSTOM_EXPRESSIONS_NOT_ALLOWED
protected final StatementType type
protected final VariableSpecifications bindVariables
public final TableMetadata metadata
public ModificationStatement(StatementType type, VariableSpecifications bindVariables, TableMetadata metadata, Operations operations, StatementRestrictions restrictions, Conditions conditions, Attributes attrs)
public java.util.List<ColumnSpecification> getBindVariables()
CQLStatement
getBindVariables
in interface CQLStatement
public short[] getPartitionKeyBindVariableIndexes()
CQLStatement
getPartitionKeyBindVariableIndexes
in interface CQLStatement
public java.lang.Iterable<Function> getFunctions()
CQLStatement
getFunctions
in interface CQLStatement
public void addFunctionsTo(java.util.List<Function> functions)
public TableMetadata metadata()
public StatementRestrictions getRestrictions()
public abstract void addUpdateForKey(PartitionUpdate.Builder updateBuilder, Clustering<?> clustering, UpdateParameters params)
public abstract void addUpdateForKey(PartitionUpdate.Builder updateBuilder, Slice slice, UpdateParameters params)
public java.lang.String keyspace()
public java.lang.String columnFamily()
public boolean isCounter()
public boolean isView()
public boolean isVirtual()
public long getTimestamp(long now, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public boolean isTimestampSet()
public int getTimeToLive(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public void authorize(ClientState state) throws InvalidRequestException, UnauthorizedException
CQLStatement
authorize
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 RegularAndStaticColumns updatedColumns()
public RegularAndStaticColumns 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<ColumnMetadata> getColumnsWithConditions()
public boolean hasIfNotExistCondition()
public boolean hasIfExistCondition()
public java.util.List<java.nio.ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public java.util.NavigableSet<Clustering<?>> createClustering(QueryOptions options) throws InvalidRequestException
InvalidRequestException
public static boolean appliesOnlyToStaticColumns(Operations operation, Conditions conditions)
true
if the specified operations and conditions only apply to static columns,
false
otherwise.public boolean requiresRead()
public boolean hasConditions()
CQLStatement
hasConditions
in interface CQLStatement
public boolean hasSlices()
public ResultMessage execute(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestExecutionException, RequestValidationException
CQLStatement
execute
in interface CQLStatement
queryState
- the current query stateoptions
- options for this query (consistency, variables, pageSize, ...)queryStartNanoTime
- the timestamp returned by System.nanoTime() when this statement was receivedRequestExecutionException
RequestValidationException
public void addConditions(Clustering<?> clustering, CQL3CasRequest request, QueryOptions options) throws InvalidRequestException
InvalidRequestException
public ResultMessage executeLocally(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatement
executeLocally
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public ResultMessage executeInternalWithoutCondition(QueryState queryState, QueryOptions options, long queryStartNanoTime) throws RequestValidationException, RequestExecutionException
public ResultMessage executeInternalWithCondition(QueryState state, QueryOptions options)
Copyright © 2009-2021 The Apache Software Foundation