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
FieldsFields inherited from class org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder
consistencyLevel, executionProfileResolver, idempotent, keyspace, pageSize, routingKey, routingKeyspace, serialConsistencyLevel, timeout, tracing -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newWriteOptionswith the configured values.consistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) Sets theConsistencyLevelto use.executionProfile(String profileName) Sets theexecution profileto use.executionProfile(ExecutionProfileResolver executionProfileResolver) Sets theExecutionProfileResolverto use.fetchSize(int pageSize) Deprecated.idempotent(boolean idempotent) Set query execution idempotency.keyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace) Sets thekeyspaceto use.pageSize(int pageSize) Sets the query fetch size forResultSetchunks.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 serialConsistencyLevelto 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.QueryOptionsBuilderSets theConsistencyLevelto use.- Overrides:
consistencyLevelin classQueryOptions.QueryOptionsBuilder- Parameters:
consistencyLevel- must not be null.- Returns:
thisQueryOptions.QueryOptionsBuilder
-
executionProfile
Description copied from class:QueryOptions.QueryOptionsBuilderSets theexecution profileto use.- Overrides:
executionProfilein classQueryOptions.QueryOptionsBuilder- Parameters:
profileName- must not be null or empty.- Returns:
thisQueryOptions.QueryOptionsBuilder- See Also:
-
Statement.setExecutionProfileName(String)
-
executionProfile
public WriteOptions.WriteOptionsBuilder executionProfile(ExecutionProfileResolver executionProfileResolver) Description copied from class:QueryOptions.QueryOptionsBuilderSets theExecutionProfileResolverto use.- Overrides:
executionProfilein classQueryOptions.QueryOptionsBuilder- Parameters:
executionProfileResolver- must not be null.- Returns:
thisQueryOptions.QueryOptionsBuilder- See Also:
-
Statement.setExecutionProfile(DriverExecutionProfile)
-
fetchSize
Deprecated.Description copied from class:QueryOptions.QueryOptionsBuilderSets the query fetch size forResultSetchunks.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:
fetchSizein 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:
thisQueryOptions.QueryOptionsBuilder
-
idempotent
Description copied from class:QueryOptions.QueryOptionsBuilderSet query execution idempotency.- Overrides:
idempotentin classQueryOptions.QueryOptionsBuilder- Parameters:
idempotent- true to mark the query as idempotent.- Returns:
thisQueryOptions.QueryOptionsBuilder.
-
keyspace
public WriteOptions.WriteOptionsBuilder keyspace(com.datastax.oss.driver.api.core.CqlIdentifier keyspace) Description copied from class:QueryOptions.QueryOptionsBuilderSets thekeyspaceto use. If left unconfigured, then the keyspace set on the statement orCqlSessionwill be used.- Overrides:
keyspacein classQueryOptions.QueryOptionsBuilder- Parameters:
keyspace- the specific keyspace to use to run a statement, must not be null.- Returns:
thisQueryOptions.QueryOptionsBuilder.
-
pageSize
Description copied from class:QueryOptions.QueryOptionsBuilderSets the query fetch size forResultSetchunks.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:
pageSizein 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:
thisQueryOptions.QueryOptionsBuilder
-
readTimeout
Deprecated.Description copied from class:QueryOptions.QueryOptionsBuilderSets the read timeout in milliseconds. Overrides the default per-host read timeout.- Overrides:
readTimeoutin 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:
thisQueryOptions.QueryOptionsBuilder- See Also:
-
Statement.setTimeout(Duration)
-
readTimeout
@Deprecated public WriteOptions.WriteOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit) Deprecated.Description copied from class:QueryOptions.QueryOptionsBuilderSets the read timeout. Overrides the default per-host read timeout.- Overrides:
readTimeoutin 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- theTimeUnitfor the supplied timeout; must not be null.- Returns:
thisQueryOptions.QueryOptionsBuilder- See Also:
-
Statement.setTimeout(Duration)
-
routingKeyspace
public WriteOptions.WriteOptionsBuilder routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace) Description copied from class:QueryOptions.QueryOptionsBuilderSet query routing keyspace.- Overrides:
routingKeyspacein classQueryOptions.QueryOptionsBuilder- Parameters:
routingKeyspace- the routing keyspace to use for token-aware routing.- Returns:
thisQueryOptions.QueryOptionsBuilder.
-
routingKey
Description copied from class:QueryOptions.QueryOptionsBuilderSet query routing key.- Overrides:
routingKeyin classQueryOptions.QueryOptionsBuilder- Parameters:
routingKey- the routing key to use for token-aware routing.- Returns:
thisQueryOptions.QueryOptionsBuilder
-
serialConsistencyLevel
public WriteOptions.WriteOptionsBuilder serialConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) Description copied from class:QueryOptions.QueryOptionsBuilderSets the serialConsistencyLevelto use.- Overrides:
serialConsistencyLevelin classQueryOptions.QueryOptionsBuilder- Parameters:
consistencyLevel- must not be null.- Returns:
thisQueryOptions.QueryOptionsBuilder
-
timeout
Description copied from class:QueryOptions.QueryOptionsBuilderSets the request timeout. Overrides the default timeout.- Overrides:
timeoutin 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:
thisQueryOptions.QueryOptionsBuilder- See Also:
-
Statement.setTimeout(Duration)
-
tracing
Description copied from class:QueryOptions.QueryOptionsBuilderEnables statement tracing.- Overrides:
tracingin classQueryOptions.QueryOptionsBuilder- Parameters:
tracing- true to enable statement tracing to the executed statements.- Returns:
thisQueryOptions.QueryOptionsBuilder
-
withTracing
Description copied from class:QueryOptions.QueryOptionsBuilderEnables statement tracing.- Overrides:
withTracingin classQueryOptions.QueryOptionsBuilder- Returns:
thisQueryOptions.QueryOptionsBuilder
-
ttl
Sets the time to live in seconds for write operations.- Parameters:
ttl- the time to live.- Returns:
thisWriteOptions.WriteOptionsBuilder
-
ttl
Sets the time to live in seconds for write operations.- Parameters:
ttl- the time to live.- Returns:
thisWriteOptions.WriteOptionsBuilder- Since:
- 2.0
-
timestamp
Sets the timestamp of write operations.- Parameters:
timestamp- mutation timestamp in microseconds.- Returns:
thisWriteOptions.WriteOptionsBuilder- Since:
- 2.1
- See Also:
-
timestamp
Sets the timestamp of write operations.- Parameters:
timestamp- mutation date time.- Returns:
thisWriteOptions.WriteOptionsBuilder- Since:
- 2.1
-
build
Builds a newWriteOptionswith the configured values.- Overrides:
buildin classQueryOptions.QueryOptionsBuilder- Returns:
- a new
WriteOptionswith the configured values
-