public class BatchStatement extends java.lang.Object implements CQLStatement, MeasurableForPreparedCache
BATCH
statement parsed from a CQL query.Modifier and Type | Class and Description |
---|---|
static class |
BatchStatement.BatchOfPreparedVariables |
static interface |
BatchStatement.BatchVariables |
static class |
BatchStatement.Parsed |
static class |
BatchStatement.PreparedBatchVariables |
static class |
BatchStatement.Type |
Modifier and Type | Field and Description |
---|---|
BatchStatement.Type |
type |
Constructor and Description |
---|
BatchStatement(int boundTerms,
BatchStatement.Type type,
java.util.List<ModificationStatement> statements,
Attributes attrs,
boolean hasConditions)
Creates a new BatchStatement from a list of statements and a
Thrift consistency level.
|
Modifier and Type | Method and Description |
---|---|
void |
checkAccess(ClientState state)
Perform any access verification necessary for the statement.
|
ResultMessage |
execute(BatchStatement.BatchVariables variables,
boolean local,
ConsistencyLevel cl,
ConsistencyLevel serialCl,
long now) |
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 |
executeWithPerStatementVariables(ConsistencyLevel cl,
QueryState queryState,
java.util.List<java.util.List<java.nio.ByteBuffer>> variables) |
int |
getBoundTerms()
Returns the number of bound terms in this statement.
|
java.util.List<ModificationStatement> |
getStatements() |
long |
measureForPreparedCache(org.github.jamm.MemoryMeter meter) |
java.lang.String |
toString() |
void |
validate(ClientState state)
Perform additional validation required by the statment.
|
public final BatchStatement.Type type
public BatchStatement(int boundTerms, BatchStatement.Type type, java.util.List<ModificationStatement> statements, Attributes attrs, boolean hasConditions)
type
- type of the batchstatements
- a list of UpdateStatementsattrs
- additional attributes for statement (CL, timestamp, timeToLive)public long measureForPreparedCache(org.github.jamm.MemoryMeter meter)
measureForPreparedCache
in interface MeasurableForPreparedCache
public int getBoundTerms()
CQLStatement
getBoundTerms
in interface CQLStatement
public void checkAccess(ClientState state) throws InvalidRequestException, UnauthorizedException
CQLStatement
checkAccess
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 java.util.List<ModificationStatement> getStatements()
public ResultMessage execute(QueryState queryState, QueryOptions options) throws RequestExecutionException, RequestValidationException
CQLStatement
execute
in interface CQLStatement
queryState
- the current query stateoptions
- options for this query (consistency, variables, pageSize, ...)RequestExecutionException
RequestValidationException
public ResultMessage executeWithPerStatementVariables(ConsistencyLevel cl, QueryState queryState, java.util.List<java.util.List<java.nio.ByteBuffer>> variables) throws RequestExecutionException, RequestValidationException
public ResultMessage execute(BatchStatement.BatchVariables variables, boolean local, ConsistencyLevel cl, ConsistencyLevel serialCl, long now) throws RequestExecutionException, RequestValidationException
public ResultMessage executeInternal(QueryState queryState, QueryOptions options) throws RequestValidationException, RequestExecutionException
CQLStatement
executeInternal
in interface CQLStatement
queryState
- the current query stateRequestValidationException
RequestExecutionException
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2015 The Apache Software Foundation