public static class QueryOptions.QueryOptionsBuilder extends Object
QueryOptions.| Modifier and Type | Method and Description |
|---|---|
QueryOptions |
build()
Builds a new
QueryOptions with the configured values. |
QueryOptions.QueryOptionsBuilder |
consistencyLevel(com.datastax.driver.core.ConsistencyLevel driverConsistencyLevel)
Sets the
ConsistencyLevel to use. |
QueryOptions.QueryOptionsBuilder |
fetchSize(int fetchSize)
Sets the query fetch size for
ResultSet chunks. |
QueryOptions.QueryOptionsBuilder |
readTimeout(long readTimeout)
Sets the read timeout in milliseconds.
|
QueryOptions.QueryOptionsBuilder |
readTimeout(long readTimeout,
TimeUnit timeUnit)
Sets the read timeout.
|
QueryOptions.QueryOptionsBuilder |
retryPolicy(RetryPolicy retryPolicy)
Sets the
RetryPolicy to use. |
QueryOptions.QueryOptionsBuilder |
retryPolicy(com.datastax.driver.core.policies.RetryPolicy driverRetryPolicy)
Sets the
driver RetryPolicy to use. |
QueryOptions.QueryOptionsBuilder |
tracing(boolean tracing)
Enables statement tracing.
|
QueryOptions.QueryOptionsBuilder |
withTracing()
Enables statement tracing.
|
public QueryOptions.QueryOptionsBuilder consistencyLevel(com.datastax.driver.core.ConsistencyLevel driverConsistencyLevel)
ConsistencyLevel to use.driverConsistencyLevel - must not be null.this QueryOptions.QueryOptionsBuilderpublic QueryOptions.QueryOptionsBuilder retryPolicy(RetryPolicy retryPolicy)
RetryPolicy to use. Setting both (RetryPolicy and
driver RetryPolicy) retry policies is not supported.retryPolicy - must not be null.this QueryOptions.QueryOptionsBuilderIllegalStateException - if the driver RetryPolicy is
setpublic QueryOptions.QueryOptionsBuilder retryPolicy(com.datastax.driver.core.policies.RetryPolicy driverRetryPolicy)
driver RetryPolicy to use. Setting both (
RetryPolicy and driver RetryPolicy) retry policies
is not supported.driverRetryPolicy - must not be null.this QueryOptions.QueryOptionsBuilderIllegalStateException - if the RetryPolicy is setpublic QueryOptions.QueryOptionsBuilder fetchSize(int fetchSize)
ResultSet chunks.
The fetch size controls how much resulting rows will be retrieved simultaneously (the goal being to avoid loading too much results in memory for queries yielding large results). Please note that while value as low as 1 can be used, it is *highly* discouraged to use such a low value in practice as it will yield very poor performance.
fetchSize - the number of rows to fetch per chunking request. To disable chunking of the result set, use
fetchSize == Integer.MAX_VALUE. Negative values are not allowed.this QueryOptions.QueryOptionsBuilderQueryOptions.getFetchSize(),
Cluster.Builder.withQueryOptions(com.datastax.driver.core.QueryOptions)public QueryOptions.QueryOptionsBuilder readTimeout(long readTimeout)
readTimeout - the read timeout in milliseconds. Negative values are not allowed. If it is 0, the read
timeout will be disabled for this statement.this QueryOptions.QueryOptionsBuilderSocketOptions.getReadTimeoutMillis(),
Cluster.Builder.withSocketOptions(SocketOptions)public QueryOptions.QueryOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit)
readTimeout - the read timeout value. Negative values are not allowed. If it is 0, the read timeout will be
disabled for this statement.timeUnit - the TimeUnit for the supplied timeout; must not be null.this QueryOptions.QueryOptionsBuilderSocketOptions.getReadTimeoutMillis(),
Cluster.Builder.withSocketOptions(SocketOptions)public QueryOptions.QueryOptionsBuilder tracing(boolean tracing)
tracing - true to enable statement tracing to the executed statements.this QueryOptions.QueryOptionsBuilderpublic QueryOptions.QueryOptionsBuilder withTracing()
this QueryOptions.QueryOptionsBuilderpublic QueryOptions build()
QueryOptions with the configured values.QueryOptions with the configured valuesCopyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.