public class BatchStatement extends java.lang.Object implements CQLStatement
BATCH
statement parsed from a CQL query.Modifier and Type | Class and Description |
---|---|
static class |
BatchStatement.Parsed |
static class |
BatchStatement.Type |
CQLStatement.Raw, CQLStatement.SingleKeyspaceCqlStatement
Modifier and Type | Field and Description |
---|---|
static BatchMetrics |
metrics |
BatchStatement.Type |
type |
Constructor and Description |
---|
BatchStatement(BatchStatement.Type type,
VariableSpecifications bindVariables,
java.util.List<ModificationStatement> statements,
Attributes attrs)
Creates a new BatchStatement.
|
Modifier and Type | Method and Description |
---|---|
void |
authorize(ClientState state)
Perform any access verification necessary for the statement.
|
ResultMessage |
execute(QueryState queryState,
BatchQueryOptions options,
long queryStartNanoTime) |
ResultMessage |
execute(QueryState queryState,
QueryOptions options,
long queryStartNanoTime)
Execute the statement and return the resulting result or null if there is no result.
|
ResultMessage |
executeLocally(QueryState queryState,
QueryOptions options)
Variant of execute used for internal query against the system tables, and thus only query the local node.
|
AuditLogContext |
getAuditLogContext()
Provides the context needed for audit logging statements.
|
java.util.List<ColumnSpecification> |
getBindVariables()
Returns all bind variables for the statement
|
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<? extends IMutation> |
getMutations(BatchQueryOptions options,
boolean local,
long batchTimestamp,
int nowInSeconds,
long queryStartNanoTime) |
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<ModificationStatement> |
getStatements() |
boolean |
hasConditions()
Whether or not this CQL Statement has LWT conditions
|
java.lang.String |
toString() |
void |
validate() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
public final BatchStatement.Type type
public static final BatchMetrics metrics
public BatchStatement(BatchStatement.Type type, VariableSpecifications bindVariables, java.util.List<ModificationStatement> statements, Attributes attrs)
type
- type of the batchstatements
- the list of statements in the batchattrs
- additional attributes for statement (CL, timestamp, timeToLive)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 authorize(ClientState state) throws InvalidRequestException, UnauthorizedException
CQLStatement
authorize
in interface CQLStatement
state
- the current client stateInvalidRequestException
UnauthorizedException
public void validate() throws InvalidRequestException
InvalidRequestException
public void validate(ClientState state) throws InvalidRequestException
CQLStatement
validate
in interface CQLStatement
state
- the current client stateInvalidRequestException
public java.util.List<ModificationStatement> getStatements()
public java.util.List<? extends IMutation> getMutations(BatchQueryOptions options, boolean local, long batchTimestamp, int nowInSeconds, long queryStartNanoTime)
public ResultMessage execute(QueryState queryState, QueryOptions options, long queryStartNanoTime)
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 receivedpublic ResultMessage execute(QueryState queryState, BatchQueryOptions options, long queryStartNanoTime)
public boolean hasConditions()
CQLStatement
hasConditions
in interface CQLStatement
public ResultMessage executeLocally(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatement
executeLocally
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public java.lang.String toString()
toString
in class java.lang.Object
public AuditLogContext getAuditLogContext()
CQLStatement
getAuditLogContext
in interface CQLStatement
Copyright © 2009-2022 The Apache Software Foundation