Class BatchStatement
java.lang.Object
org.apache.cassandra.cql3.statements.BatchStatement
- All Implemented Interfaces:
CQLStatement
A
BATCH statement parsed from a CQL query.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumNested classes/interfaces inherited from interface org.apache.cassandra.cql3.CQLStatement
CQLStatement.Raw, CQLStatement.SingleKeyspaceCqlStatement -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBatchStatement(BatchStatement.Type type, VariableSpecifications bindVariables, List<ModificationStatement> statements, Attributes attrs) Creates a new BatchStatement. -
Method Summary
Modifier and TypeMethodDescriptionvoidauthorize(ClientState state) Perform any access verification necessary for the statement.execute(QueryState queryState, BatchQueryOptions options, Dispatcher.RequestTime requestTime) execute(QueryState queryState, QueryOptions options, Dispatcher.RequestTime requestTime) Execute the statement and return the resulting result or null if there is no result.executeLocally(QueryState queryState, QueryOptions options) Variant of execute used for internal query against the system tables, and thus only query the local node.Provides the context needed for audit logging statements.Returns all bind variables for the statementReturn an Iterable over all of the functions (both native and user-defined) used by any component of the statementgetMutations(ClientState state, BatchQueryOptions options, boolean local, long batchTimestamp, long nowInSeconds, Dispatcher.RequestTime requestTime) short[]Returns an array with the same length as the number of partition key columns for the table corresponding to table.booleanWhether or not this CQL Statement has LWT conditionstoString()voidvalidate()voidvalidate(ClientState state) Perform additional validation required by the statment.
-
Field Details
-
type
-
metrics
-
-
Constructor Details
-
BatchStatement
public BatchStatement(BatchStatement.Type type, VariableSpecifications bindVariables, List<ModificationStatement> statements, Attributes attrs) Creates a new BatchStatement.- Parameters:
type- type of the batchstatements- the list of statements in the batchattrs- additional attributes for statement (CL, timestamp, timeToLive)
-
-
Method Details
-
getBindVariables
Description copied from interface:CQLStatementReturns all bind variables for the statement- Specified by:
getBindVariablesin interfaceCQLStatement
-
getPartitionKeyBindVariableIndexes
public short[] getPartitionKeyBindVariableIndexes()Description copied from interface:CQLStatementReturns an array with the same length as the number of partition key columns for the table corresponding to table. Each short in the array represents the bind index of the marker that holds the value for that partition key column. If there are no bind markers for any of the partition key columns, null is returned.- Specified by:
getPartitionKeyBindVariableIndexesin interfaceCQLStatement
-
getFunctions
Description copied from interface:CQLStatementReturn an Iterable over all of the functions (both native and user-defined) used by any component of the statement- Specified by:
getFunctionsin interfaceCQLStatement- Returns:
- functions all functions found (may contain duplicates)
-
authorize
Description copied from interface:CQLStatementPerform any access verification necessary for the statement.- Specified by:
authorizein interfaceCQLStatement- Parameters:
state- the current client state- Throws:
InvalidRequestExceptionUnauthorizedException
-
validate
- Throws:
InvalidRequestException
-
validate
Description copied from interface:CQLStatementPerform additional validation required by the statment. To be overriden by subclasses if needed.- Specified by:
validatein interfaceCQLStatement- Parameters:
state- the current client state- Throws:
InvalidRequestException
-
getStatements
-
getMutations
public List<? extends IMutation> getMutations(ClientState state, BatchQueryOptions options, boolean local, long batchTimestamp, long nowInSeconds, Dispatcher.RequestTime requestTime) -
execute
public ResultMessage execute(QueryState queryState, QueryOptions options, Dispatcher.RequestTime requestTime) Description copied from interface:CQLStatementExecute the statement and return the resulting result or null if there is no result.- Specified by:
executein interfaceCQLStatement- Parameters:
queryState- the current query stateoptions- options for this query (consistency, variables, pageSize, ...)requestTime- request enqueue / and start times;
-
execute
public ResultMessage execute(QueryState queryState, BatchQueryOptions options, Dispatcher.RequestTime requestTime) -
hasConditions
public boolean hasConditions()Description copied from interface:CQLStatementWhether or not this CQL Statement has LWT conditions- Specified by:
hasConditionsin interfaceCQLStatement
-
executeLocally
public ResultMessage executeLocally(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException Description copied from interface:CQLStatementVariant of execute used for internal query against the system tables, and thus only query the local node.- Specified by:
executeLocallyin interfaceCQLStatement- Parameters:
queryState- the current query state- Throws:
RequestValidationExceptionRequestExecutionException
-
toString
-
getAuditLogContext
Description copied from interface:CQLStatementProvides the context needed for audit logging statements.- Specified by:
getAuditLogContextin interfaceCQLStatement
-