Class WriteOptions.WriteOptionsBuilder
java.lang.Object
org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder
org.springframework.data.cassandra.core.cql.WriteOptions.WriteOptionsBuilder
- Direct Known Subclasses:
DeleteOptions.DeleteOptionsBuilder
,InsertOptions.InsertOptionsBuilder
,UpdateOptions.UpdateOptionsBuilder
- Enclosing class:
- WriteOptions
Builder for
WriteOptions
.- Since:
- 1.5
- Author:
- Mark Paluch, Lukasz Antoniak, Thomas Strauß, Tudor Marc
-
Field Summary
Fields inherited from class org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder
consistencyLevel, executionProfileResolver, idempotent, keyspace, pageSize, routingKey, routingKeyspace, serialConsistencyLevel, timeout, tracing
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newWriteOptions
with the configured values.consistencyLevel
(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) Sets theConsistencyLevel
to use.executionProfile
(String profileName) Sets theexecution profile
to use.executionProfile
(ExecutionProfileResolver executionProfileResolver) Sets theExecutionProfileResolver
to use.fetchSize
(int pageSize) Deprecated.idempotent
(boolean idempotent) Set query execution idempotency.keyspace
(com.datastax.oss.driver.api.core.CqlIdentifier keyspace) Sets thekeyspace
to use.pageSize
(int pageSize) Sets the query fetch size forResultSet
chunks.readTimeout
(long readTimeout) Deprecated.readTimeout
(long readTimeout, TimeUnit timeUnit) Deprecated.routingKey
(ByteBuffer routingKey) Set query routing key.routingKeyspace
(com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace) Set query routing keyspace.serialConsistencyLevel
(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) Sets the serialConsistencyLevel
to use.Sets the request timeout.timestamp
(long timestamp) Sets the timestamp of write operations.Sets the timestamp of write operations.tracing
(boolean tracing) Enables statement tracing.ttl
(int ttl) Sets the time to live in seconds for write operations.Sets the time to live in seconds for write operations.Enables statement tracing.Methods inherited from class org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder
readTimeout
-
Field Details
-
ttl
-
timestamp
-
-
Constructor Details
-
WriteOptionsBuilder
protected WriteOptionsBuilder() -
WriteOptionsBuilder
-
-
Method Details
-
consistencyLevel
public WriteOptions.WriteOptionsBuilder consistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) Description copied from class:QueryOptions.QueryOptionsBuilder
Sets theConsistencyLevel
to use.- Overrides:
consistencyLevel
in classQueryOptions.QueryOptionsBuilder
- Parameters:
consistencyLevel
- must not be null.- Returns:
this
QueryOptions.QueryOptionsBuilder
-
executionProfile
Description copied from class:QueryOptions.QueryOptionsBuilder
Sets theexecution profile
to use.- Overrides:
executionProfile
in classQueryOptions.QueryOptionsBuilder
- Parameters:
profileName
- must not be null or empty.- Returns:
this
QueryOptions.QueryOptionsBuilder
- See Also:
-
Statement.setExecutionProfileName(String)
-
executionProfile
public WriteOptions.WriteOptionsBuilder executionProfile(ExecutionProfileResolver executionProfileResolver) Description copied from class:QueryOptions.QueryOptionsBuilder
Sets theExecutionProfileResolver
to use.- Overrides:
executionProfile
in classQueryOptions.QueryOptionsBuilder
- Parameters:
executionProfileResolver
- must not be null.- Returns:
this
QueryOptions.QueryOptionsBuilder
- See Also:
-
Statement.setExecutionProfile(DriverExecutionProfile)
-
fetchSize
Deprecated.Description copied from class:QueryOptions.QueryOptionsBuilder
Sets the query fetch size forResultSet
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.
- Overrides:
fetchSize
in classQueryOptions.QueryOptionsBuilder
- Parameters:
pageSize
- the number of rows to fetch per chunking request. To disable chunking of the result set, usefetchSize == Integer.MAX_VALUE
. Negative values are not allowed.- Returns:
this
QueryOptions.QueryOptionsBuilder
-
idempotent
Description copied from class:QueryOptions.QueryOptionsBuilder
Set query execution idempotency.- Overrides:
idempotent
in classQueryOptions.QueryOptionsBuilder
- Parameters:
idempotent
- true to mark the query as idempotent.- Returns:
this
QueryOptions.QueryOptionsBuilder
.
-
keyspace
public WriteOptions.WriteOptionsBuilder keyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace) Description copied from class:QueryOptions.QueryOptionsBuilder
Sets thekeyspace
to use. If left unconfigured, then the keyspace set on the statement orCqlSession
will be used.- Overrides:
keyspace
in classQueryOptions.QueryOptionsBuilder
- Parameters:
keyspace
- the specific keyspace to use to run a statement, must not be null.- Returns:
this
QueryOptions.QueryOptionsBuilder
.
-
pageSize
Description copied from class:QueryOptions.QueryOptionsBuilder
Sets the query fetch size forResultSet
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.
- Overrides:
pageSize
in classQueryOptions.QueryOptionsBuilder
- Parameters:
pageSize
- the number of rows to fetch per chunking request. To disable chunking of the result set, usepageSize == Integer.MAX_VALUE
. Negative values are not allowed.- Returns:
this
QueryOptions.QueryOptionsBuilder
-
readTimeout
Deprecated.Description copied from class:QueryOptions.QueryOptionsBuilder
Sets the read timeout in milliseconds. Overrides the default per-host read timeout.- Overrides:
readTimeout
in classQueryOptions.QueryOptionsBuilder
- Parameters:
readTimeout
- the read timeout in milliseconds. Negative values are not allowed. If it is0
, the read timeout will be disabled for this statement.- Returns:
this
QueryOptions.QueryOptionsBuilder
- See Also:
-
Statement.setTimeout(Duration)
-
readTimeout
@Deprecated public WriteOptions.WriteOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit) Deprecated.Description copied from class:QueryOptions.QueryOptionsBuilder
Sets the read timeout. Overrides the default per-host read timeout.- Overrides:
readTimeout
in classQueryOptions.QueryOptionsBuilder
- Parameters:
readTimeout
- the read timeout value. Negative values are not allowed. If it is0
, the read timeout will be disabled for this statement.timeUnit
- theTimeUnit
for the supplied timeout; must not be null.- Returns:
this
QueryOptions.QueryOptionsBuilder
- See Also:
-
Statement.setTimeout(Duration)
-
routingKeyspace
public WriteOptions.WriteOptionsBuilder routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace) Description copied from class:QueryOptions.QueryOptionsBuilder
Set query routing keyspace.- Overrides:
routingKeyspace
in classQueryOptions.QueryOptionsBuilder
- Parameters:
routingKeyspace
- the routing keyspace to use for token-aware routing.- Returns:
this
QueryOptions.QueryOptionsBuilder
.
-
routingKey
Description copied from class:QueryOptions.QueryOptionsBuilder
Set query routing key.- Overrides:
routingKey
in classQueryOptions.QueryOptionsBuilder
- Parameters:
routingKey
- the routing key to use for token-aware routing.- Returns:
this
QueryOptions.QueryOptionsBuilder
-
serialConsistencyLevel
public WriteOptions.WriteOptionsBuilder serialConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) Description copied from class:QueryOptions.QueryOptionsBuilder
Sets the serialConsistencyLevel
to use.- Overrides:
serialConsistencyLevel
in classQueryOptions.QueryOptionsBuilder
- Parameters:
consistencyLevel
- must not be null.- Returns:
this
QueryOptions.QueryOptionsBuilder
-
timeout
Description copied from class:QueryOptions.QueryOptionsBuilder
Sets the request timeout. Overrides the default timeout.- Overrides:
timeout
in classQueryOptions.QueryOptionsBuilder
- Parameters:
timeout
- the read timeout. Negative values are not allowed. If it is0
, the read timeout will be disabled for this statement.- Returns:
this
QueryOptions.QueryOptionsBuilder
- See Also:
-
Statement.setTimeout(Duration)
-
tracing
Description copied from class:QueryOptions.QueryOptionsBuilder
Enables statement tracing.- Overrides:
tracing
in classQueryOptions.QueryOptionsBuilder
- Parameters:
tracing
- true to enable statement tracing to the executed statements.- Returns:
this
QueryOptions.QueryOptionsBuilder
-
withTracing
Description copied from class:QueryOptions.QueryOptionsBuilder
Enables statement tracing.- Overrides:
withTracing
in classQueryOptions.QueryOptionsBuilder
- Returns:
this
QueryOptions.QueryOptionsBuilder
-
ttl
Sets the time to live in seconds for write operations.- Parameters:
ttl
- the time to live.- Returns:
this
WriteOptions.WriteOptionsBuilder
-
ttl
Sets the time to live in seconds for write operations.- Parameters:
ttl
- the time to live.- Returns:
this
WriteOptions.WriteOptionsBuilder
- Since:
- 2.0
-
timestamp
Sets the timestamp of write operations.- Parameters:
timestamp
- mutation timestamp in microseconds.- Returns:
this
WriteOptions.WriteOptionsBuilder
- Since:
- 2.1
- See Also:
-
timestamp
Sets the timestamp of write operations.- Parameters:
timestamp
- mutation date time.- Returns:
this
WriteOptions.WriteOptionsBuilder
- Since:
- 2.1
-
build
Builds a newWriteOptions
with the configured values.- Overrides:
build
in classQueryOptions.QueryOptionsBuilder
- Returns:
- a new
WriteOptions
with the configured values
-