public static class QueryOptions.QueryOptionsBuilder extends Object
QueryOptions
.Modifier and Type | Field and Description |
---|---|
protected com.datastax.oss.driver.api.core.ConsistencyLevel |
consistencyLevel |
protected ExecutionProfileResolver |
executionProfileResolver |
protected Boolean |
idempotent |
protected com.datastax.oss.driver.api.core.CqlIdentifier |
keyspace |
protected Integer |
pageSize |
protected ByteBuffer |
routingKey |
protected com.datastax.oss.driver.api.core.CqlIdentifier |
routingKeyspace |
protected com.datastax.oss.driver.api.core.ConsistencyLevel |
serialConsistencyLevel |
protected Duration |
timeout |
protected Boolean |
tracing |
Modifier and Type | Method and Description |
---|---|
QueryOptions |
build()
Builds a new
QueryOptions with the configured values. |
QueryOptions.QueryOptionsBuilder |
consistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel)
Sets the
ConsistencyLevel to use. |
QueryOptions.QueryOptionsBuilder |
executionProfile(ExecutionProfileResolver executionProfileResolver)
Sets the
ExecutionProfileResolver to use. |
QueryOptions.QueryOptionsBuilder |
executionProfile(String profileName)
Sets the
execution profile to use. |
QueryOptions.QueryOptionsBuilder |
fetchSize(int fetchSize)
Deprecated.
since 3.0, use
pageSize(int) . |
QueryOptions.QueryOptionsBuilder |
idempotent(boolean idempotent)
Set query execution idempotency.
|
QueryOptions.QueryOptionsBuilder |
keyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace)
Sets the
keyspace to use. |
QueryOptions.QueryOptionsBuilder |
pageSize(int pageSize)
Sets the query fetch size for
ResultSet chunks. |
QueryOptions.QueryOptionsBuilder |
readTimeout(Duration readTimeout)
Deprecated.
since 3.0, use
timeout(Duration) |
QueryOptions.QueryOptionsBuilder |
readTimeout(long readTimeout)
Deprecated.
since 3.0, use
timeout(Duration) |
QueryOptions.QueryOptionsBuilder |
readTimeout(long readTimeout,
TimeUnit timeUnit)
Deprecated.
since 2.0, use
timeout(Duration) . |
QueryOptions.QueryOptionsBuilder |
routingKey(ByteBuffer routingKey)
Set query routing key.
|
QueryOptions.QueryOptionsBuilder |
routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace)
Set query routing keyspace.
|
QueryOptions.QueryOptionsBuilder |
serialConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel)
Sets the serial
ConsistencyLevel to use. |
QueryOptions.QueryOptionsBuilder |
timeout(Duration timeout)
Sets the request timeout.
|
QueryOptions.QueryOptionsBuilder |
tracing(boolean tracing)
Enables statement tracing.
|
QueryOptions.QueryOptionsBuilder |
withTracing()
Enables statement tracing.
|
@Nullable protected com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel
protected ExecutionProfileResolver executionProfileResolver
@Nullable protected com.datastax.oss.driver.api.core.CqlIdentifier keyspace
@Nullable protected ByteBuffer routingKey
@Nullable protected com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace
@Nullable protected com.datastax.oss.driver.api.core.ConsistencyLevel serialConsistencyLevel
protected Duration timeout
public QueryOptions.QueryOptionsBuilder consistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel)
ConsistencyLevel
to use.consistencyLevel
- must not be null.this
QueryOptions.QueryOptionsBuilder
public QueryOptions.QueryOptionsBuilder executionProfile(String profileName)
execution profile
to use.profileName
- must not be null or empty.this
QueryOptions.QueryOptionsBuilder
Statement.setExecutionProfileName(String)
public QueryOptions.QueryOptionsBuilder executionProfile(ExecutionProfileResolver executionProfileResolver)
ExecutionProfileResolver
to use.executionProfileResolver
- must not be null.this
QueryOptions.QueryOptionsBuilder
Statement.setExecutionProfile(DriverExecutionProfile)
@Deprecated public QueryOptions.QueryOptionsBuilder fetchSize(int fetchSize)
pageSize(int)
.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.QueryOptionsBuilder
public QueryOptions.QueryOptionsBuilder idempotent(boolean idempotent)
idempotent
- true to mark the query as idempotent.this
QueryOptions.QueryOptionsBuilder
.public QueryOptions.QueryOptionsBuilder keyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace)
keyspace
to use. If left unconfigured, then the keyspace set on the statement or
CqlSession
will be used.keyspace
- the specific keyspace to use to run a statement, must not be null.this
QueryOptions.QueryOptionsBuilder
.public QueryOptions.QueryOptionsBuilder pageSize(int pageSize)
ResultSet
chunks.
The fetch size controls how much resulting rows will be retrieved simultaneously (the goal being to avoid loading too many 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.
pageSize
- the number of rows to fetch per chunking request. To disable chunking of the result set, use
pageSize == Integer.MAX_VALUE
. Negative values are not allowed.this
QueryOptions.QueryOptionsBuilder
@Deprecated public QueryOptions.QueryOptionsBuilder readTimeout(long readTimeout)
timeout(Duration)
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.QueryOptionsBuilder
Statement.setTimeout(Duration)
@Deprecated public QueryOptions.QueryOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit)
timeout(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.QueryOptionsBuilder
Statement.setTimeout(Duration)
@Deprecated public QueryOptions.QueryOptionsBuilder readTimeout(Duration readTimeout)
timeout(Duration)
readTimeout
- the read timeout. Negative values are not allowed. If it is 0
, the read timeout will
be disabled for this statement.this
QueryOptions.QueryOptionsBuilder
Statement.setTimeout(Duration)
public QueryOptions.QueryOptionsBuilder routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace)
routingKeyspace
- the routing keyspace to use for token-aware routing.this
QueryOptions.QueryOptionsBuilder
.public QueryOptions.QueryOptionsBuilder routingKey(ByteBuffer routingKey)
routingKey
- the routing key to use for token-aware routing.this
QueryOptions.QueryOptionsBuilder
public QueryOptions.QueryOptionsBuilder serialConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel)
ConsistencyLevel
to use.consistencyLevel
- must not be null.this
QueryOptions.QueryOptionsBuilder
public QueryOptions.QueryOptionsBuilder timeout(Duration timeout)
timeout
- the read timeout. Negative values are not allowed. If it is 0
, the read timeout will be
disabled for this statement.this
QueryOptions.QueryOptionsBuilder
Statement.setTimeout(Duration)
public QueryOptions.QueryOptionsBuilder tracing(boolean tracing)
tracing
- true to enable statement tracing to the executed statements.this
QueryOptions.QueryOptionsBuilder
public QueryOptions.QueryOptionsBuilder withTracing()
this
QueryOptions.QueryOptionsBuilder
public QueryOptions build()
QueryOptions
with the configured values.QueryOptions
with the configured valuesCopyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.