public static class QueryOptions.QueryOptionsBuilder extends Object
QueryOptions.| Modifier and Type | Field and Description |
|---|---|
protected com.datastax.driver.core.ConsistencyLevel |
consistencyLevel |
protected Integer |
fetchSize |
protected Duration |
readTimeout |
protected com.datastax.driver.core.policies.RetryPolicy |
retryPolicy |
protected Boolean |
tracing |
| Modifier and Type | Method and Description |
|---|---|
QueryOptions |
build()
Builds a new
QueryOptions with the configured values. |
QueryOptions.QueryOptionsBuilder |
consistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
Sets the
ConsistencyLevel to use. |
QueryOptions.QueryOptionsBuilder |
fetchSize(int fetchSize)
Sets the query fetch size for
ResultSet chunks. |
QueryOptions.QueryOptionsBuilder |
readTimeout(Duration readTimeout)
Sets the read timeout.
|
QueryOptions.QueryOptionsBuilder |
readTimeout(long readTimeout)
Sets the read timeout in milliseconds.
|
QueryOptions.QueryOptionsBuilder |
readTimeout(long readTimeout,
TimeUnit timeUnit)
Deprecated.
since 2.0, use
readTimeout(Duration). |
QueryOptions.QueryOptionsBuilder |
retryPolicy(com.datastax.driver.core.policies.RetryPolicy retryPolicy)
Sets the
driver RetryPolicy to use. |
QueryOptions.QueryOptionsBuilder |
tracing(boolean tracing)
Enables statement tracing.
|
QueryOptions.QueryOptionsBuilder |
withTracing()
Enables statement tracing.
|
@Nullable protected com.datastax.driver.core.ConsistencyLevel consistencyLevel
protected Duration readTimeout
@Nullable protected com.datastax.driver.core.policies.RetryPolicy retryPolicy
public QueryOptions.QueryOptionsBuilder consistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
ConsistencyLevel to use.consistencyLevel - must not be null.this QueryOptions.QueryOptionsBuilderpublic QueryOptions.QueryOptionsBuilder retryPolicy(com.datastax.driver.core.policies.RetryPolicy retryPolicy)
driver RetryPolicy to use. Setting both ( RetryPolicy and driver RetryPolicy) retry policies is not supported.retryPolicy - must not be null.this QueryOptions.QueryOptionsBuilderpublic 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)@Deprecated public QueryOptions.QueryOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit)
readTimeout(Duration).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 readTimeout(Duration readTimeout)
readTimeout - the read timeout. 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 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–2018 Pivotal Software, Inc.. All rights reserved.