R - The type of result returned when executing this statementF - The type of future result returned when executing this statementT - The type of POJO associated with this statementpublic abstract class GroupStatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T> extends StatementImpl<R,F,T>
GroupStatementImpl abstract class extends the StatementImpl
class to provide support for a statement that represents a group (not a
batch) of statements that can be executed in parallel.bridge, CI_PREFIX, idempotent, isCounterOp, mgr, MK_PREFIX, resultClass, simpleSize, UDT_C_PREFIX| Modifier | Constructor and Description |
|---|---|
protected |
GroupStatementImpl(Class<R> resultClass,
ClassInfoImpl.Context context,
StatementManagerImpl mgr,
StatementBridge bridge)
Instantiates a new
GroupStatementImpl object. |
protected |
GroupStatementImpl(Class<R> resultClass,
String keyspace,
StatementManagerImpl mgr,
StatementBridge bridge)
Instantiates a new
GroupStatementImpl object. |
protected |
GroupStatementImpl(GroupStatementImpl<R,F,T> group)
Instantiates a new
GroupStatementImpl object. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendGroupType(StringBuilder builder)
Appends the type of group this is; used when building a query string.
|
protected abstract List<StatementImpl<?,?,?>> |
buildGroupedStatements()
Gets all underlying grouped statements recursively in the proper order
for this statement.
|
protected StringBuilder[] |
buildQueryStrings()
Builds the query strings (one per underlying statement) to be collected if
the statement represents some a batch, sequence, or a group statement.
|
protected List<StatementImpl<?,?,?>> |
buildStatements()
Gets all underlying statements or this statement if none contained within.
|
protected com.datastax.driver.core.ResultSetFuture |
executeAsyncRaw0()
Executes the provided statement asynchronously and returned a raw result set.
|
int |
getParallelFactor()
Gets the number of simultaneous statements to send to the Cassandra cluster
at the same time before starting to wait for all responses before proceeding
to the next set (assuming a sequence is not reached before that).
|
Boolean |
isIdempotent() |
protected void |
setDirty()
Sets the dirty bit for the cached query string and clear the number of
statements.
|
<H> H |
setParallelFactor(int factor)
Sets the number of simultaneous statements to send to the Cassandra cluster
at the same time before starting to wait for all responses before proceeding
to the next set (assuming a sequence is not reached before that).
|
protected int |
simpleSize()
Gets the number of simple statements in this statement.
|
appendGroupSubType, appendOptions, buildQueryString, clearKeyspace, disable, disableErrorTracing, disableTracing, enable, enableErrorTracing, enableErrorTracing, enableTracing, enableTracing, execute, executeAsync, executeAsync0, executeAsyncRaw, executeRaw, getClassInfo, getClassInfoImpl, getConsistencyLevel, getContext, getDefaultTimestamp, getFetchSize, getKeyspace, getObject, getObjectClass, getPOJOContext, getQueryString, getReadTimeoutMillis, getRetryPolicy, getSerialConsistencyLevel, getUserData, init, init, isCounterOp, isDirty, isEnabled, isErrorTracing, isTracing, setConsistencyLevel, setCounterOp, setDefaultTimestamp, setDirty, setFetchSize, setIdempotent, setReadTimeoutMillis, setRetryPolicy, setSerialConsistencyLevel, setUserData, toStringprotected GroupStatementImpl(Class<R> resultClass, ClassInfoImpl.Context context, StatementManagerImpl mgr, StatementBridge bridge)
GroupStatementImpl object.resultClass - the result class from the execution of this statementcontext - the class info context for the POJO associated with this
statement or null if this statement is not associated
with a POJOmgr - the non-null statement managerbridge - the non-null statement bridgeNullPointerException - if resultClass is nullIllegalArgumentException - if the result class is not a supported oneprotected GroupStatementImpl(Class<R> resultClass, String keyspace, StatementManagerImpl mgr, StatementBridge bridge)
GroupStatementImpl object.resultClass - the result class from the execution of this statementkeyspace - the keyspace for this statement if knownmgr - the non-null statement managerbridge - the non-null statement bridgeNullPointerException - if resultClass is nullIllegalArgumentException - if the result class is not a supported oneprotected GroupStatementImpl(GroupStatementImpl<R,F,T> group)
GroupStatementImpl object.group - the non-null statement being copied or
wrappedprotected abstract List<StatementImpl<?,?,?>> buildGroupedStatements()
null list of all underlying statements from this
statementprotected void appendGroupType(StringBuilder builder)
appendGroupType in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>builder - the builder to which to append the type of groupStatementImpl.appendGroupType(java.lang.StringBuilder)protected final List<StatementImpl<?,?,?>> buildStatements()
Note: Any statements that contains other statements should be flattened out based on its type. For example, a batch will flattened out all included batches recursively. A sequence will do the same with contained sequences but not with contained groups or batches. A group will do the same with contained groups but not with contained sequences or batches.
buildStatements in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>null list of all underlying statements from this
statementStatementImpl.buildStatements()protected final int simpleSize()
simpleSize in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>StatementImpl.simpleSize()protected final StringBuilder[] buildQueryStrings()
buildQueryStrings in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>null if nothing to batchStatementImpl.buildQueryStrings()protected void setDirty()
setDirty in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>StatementImpl.setDirty()protected com.datastax.driver.core.ResultSetFuture executeAsyncRaw0()
ResultSetFuture.
Note that for queries that doesn't return a result (INSERT, UPDATE and
DELETE), you will need to access the ResultSetFuture (that is call one of
its get method) to make sure the statement was successful.executeAsyncRaw0 in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>StatementImpl.executeAsyncRaw0()public int getParallelFactor()
By default, the parallel factor will be based on the number of nodes in the Cassandra cluster multiplied by 32 (default number of threads in the write pool of a Cassandra node).
Note: This value will be adjusted based on the maximum replication factor used by any of the statements. It will also be automatically limited to 32 if any of the statements affects all nodes such as schema, table, type, or index creation or alteration statements.
public <H> H setParallelFactor(int factor)
By default, the parallel factor will be based on the number of nodes in the Cassandra cluster multiplied by 32 (default number of threads in the write pool of a Cassandra node).
Note: This value will be adjusted based on the maximum replication factor used by any of the statements. It will also be automatically limited to 32 if any of the statements affects all nodes such as schema, table, type, or index creation or alteration statements.
H - the type of "this" to be returnedfactor - the new parallel factor to use when sending simultaneous
statementspublic Boolean isIdempotent()
isIdempotent in interface GenericStatement<R,F extends com.google.common.util.concurrent.ListenableFuture<R>>isIdempotent in class StatementImpl<R,F extends com.google.common.util.concurrent.ListenableFuture<R>,T>StatementImpl.isIdempotent()Copyright (C) 2015-2017 The Helenus Driver Project Authors.