public static class WriteOptions.WriteOptionsBuilder extends QueryOptions.QueryOptionsBuilder
QueryOptions
.Modifier | Constructor and Description |
---|---|
protected |
WriteOptionsBuilder() |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
applyOptions(T queryOptions) |
WriteOptions |
build()
Builds a new
WriteOptions with the configured values. |
WriteOptions.WriteOptionsBuilder |
consistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
Sets the
ConsistencyLevel to use. |
WriteOptions.WriteOptionsBuilder |
fetchSize(int fetchSize)
Sets the query fetch size for
ResultSet chunks. |
WriteOptions.WriteOptionsBuilder |
readTimeout(long readTimeout)
Sets the read timeout in milliseconds.
|
WriteOptions.WriteOptionsBuilder |
readTimeout(long readTimeout,
TimeUnit timeUnit)
Sets the read timeout.
|
WriteOptions.WriteOptionsBuilder |
retryPolicy(com.datastax.driver.core.policies.RetryPolicy driverRetryPolicy)
Sets the
driver RetryPolicy to use. |
WriteOptions.WriteOptionsBuilder |
tracing(boolean tracing)
Enables statement tracing.
|
WriteOptions.WriteOptionsBuilder |
ttl(int ttl)
Sets the time to live for write operations.
|
WriteOptions.WriteOptionsBuilder |
withTracing()
Enables statement tracing.
|
public WriteOptions.WriteOptionsBuilder consistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
QueryOptions.QueryOptionsBuilder
ConsistencyLevel
to use.consistencyLevel
in class QueryOptions.QueryOptionsBuilder
consistencyLevel
- must not be null.this
QueryOptions.QueryOptionsBuilder
public WriteOptions.WriteOptionsBuilder retryPolicy(com.datastax.driver.core.policies.RetryPolicy driverRetryPolicy)
QueryOptions.QueryOptionsBuilder
driver RetryPolicy
to use. Setting both ( RetryPolicy
and driver RetryPolicy
) retry policies is not supported.retryPolicy
in class QueryOptions.QueryOptionsBuilder
driverRetryPolicy
- must not be null.this
QueryOptions.QueryOptionsBuilder
public WriteOptions.WriteOptionsBuilder fetchSize(int fetchSize)
QueryOptions.QueryOptionsBuilder
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
in class QueryOptions.QueryOptionsBuilder
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
QueryOptions.getFetchSize()
,
Cluster.Builder.withQueryOptions(com.datastax.driver.core.QueryOptions)
public WriteOptions.WriteOptionsBuilder readTimeout(long readTimeout)
QueryOptions.QueryOptionsBuilder
readTimeout
in class QueryOptions.QueryOptionsBuilder
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
SocketOptions.getReadTimeoutMillis()
,
Cluster.Builder.withSocketOptions(SocketOptions)
public WriteOptions.WriteOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit)
QueryOptions.QueryOptionsBuilder
readTimeout
in class QueryOptions.QueryOptionsBuilder
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
SocketOptions.getReadTimeoutMillis()
,
Cluster.Builder.withSocketOptions(SocketOptions)
public WriteOptions.WriteOptionsBuilder tracing(boolean tracing)
QueryOptions.QueryOptionsBuilder
tracing
in class QueryOptions.QueryOptionsBuilder
tracing
- true to enable statement tracing to the executed statements.this
QueryOptions.QueryOptionsBuilder
public WriteOptions.WriteOptionsBuilder withTracing()
QueryOptions.QueryOptionsBuilder
withTracing
in class QueryOptions.QueryOptionsBuilder
this
QueryOptions.QueryOptionsBuilder
public WriteOptions.WriteOptionsBuilder ttl(int ttl)
ttl
- the time to live.this
WriteOptions.WriteOptionsBuilder
public WriteOptions build()
WriteOptions
with the configured values.build
in class QueryOptions.QueryOptionsBuilder
WriteOptions
with the configured valuesprotected <T> T applyOptions(T queryOptions)
applyOptions
in class QueryOptions.QueryOptionsBuilder
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.