Class QueryOptions
java.lang.Object
org.springframework.data.cassandra.core.cql.QueryOptions
- Direct Known Subclasses:
WriteOptions
Cassandra Query Options for queries.
QueryOptions
allow tuning of various query options on a per-request
level. Only options that are set are applied to queries.- Author:
- David Webb, Mark Paluch, Tomasz Lelek, Sam Lightfoot
-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
QueryOptions
(com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel, ExecutionProfileResolver executionProfileResolver, Boolean idempotent, com.datastax.oss.driver.api.core.CqlIdentifier keyspace, Integer pageSize, com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace, ByteBuffer routingKey, com.datastax.oss.driver.api.core.ConsistencyLevel serialConsistencyLevel, Duration timeout, Boolean tracing) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a newQueryOptions.QueryOptionsBuilder
.static QueryOptions
empty()
Create defaultQueryOptions
.boolean
protected com.datastax.oss.driver.api.core.ConsistencyLevel
protected ExecutionProfileResolver
com.datastax.oss.driver.api.core.CqlIdentifier
protected Integer
protected Duration
Deprecated.protected ByteBuffer
protected com.datastax.oss.driver.api.core.CqlIdentifier
protected com.datastax.oss.driver.api.core.ConsistencyLevel
protected Duration
protected Boolean
int
hashCode()
protected Boolean
mutate()
Create a newQueryOptions.QueryOptionsBuilder
to mutate properties of thisQueryOptions
.
-
Constructor Details
-
QueryOptions
protected QueryOptions(@Nullable com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel, ExecutionProfileResolver executionProfileResolver, @Nullable Boolean idempotent, @Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, @Nullable Integer pageSize, @Nullable com.datastax.oss.driver.api.core.CqlIdentifier routingKeyspace, @Nullable ByteBuffer routingKey, @Nullable com.datastax.oss.driver.api.core.ConsistencyLevel serialConsistencyLevel, Duration timeout, @Nullable Boolean tracing)
-
-
Method Details
-
builder
Create a newQueryOptions.QueryOptionsBuilder
.- Returns:
- a new
QueryOptions.QueryOptionsBuilder
. - Since:
- 1.5
-
empty
Create defaultQueryOptions
.- Returns:
- default
QueryOptions
. - Since:
- 2.0
-
mutate
Create a newQueryOptions.QueryOptionsBuilder
to mutate properties of thisQueryOptions
.- Returns:
- a new
QueryOptions.QueryOptionsBuilder
initialized with thisQueryOptions
. - Since:
- 2.0
-
getConsistencyLevel
- Returns:
- the driver
ConsistencyLevel
. - Since:
- 1.5
-
getExecutionProfileResolver
- Returns:
- the
ExecutionProfileResolver
. - Since:
- 3.0
-
isIdempotent
- Returns:
- whether query is idempotent. May be null if not set.
- Since:
- 3.4
- See Also:
-
Statement.setIdempotent(Boolean)
-
getKeyspace
- Returns:
- the keyspace associated with the query. If it is null, it means that either keyspace configured
on the statement or from the
CqlSession
will be used. - Since:
- 3.1
-
getPageSize
- Returns:
- the number of rows to fetch per chunking request. May be null if not set.
- Since:
- 1.5
-
getReadTimeout
Deprecated.since 3.0, usegetTimeout()
instead.- Returns:
- the command timeout. May be
negative
if not set. - Since:
- 1.5
- See Also:
-
Statement.setTimeout(Duration)
-
getRoutingKeyspace
- Returns:
- the keyspace used for token-aware routing. May be null if token-aware routing is disabled.
- Since:
- 3.4
- See Also:
-
Statement.setRoutingKeyspace(CqlIdentifier)
-
getRoutingKey
- Returns:
- the key used for token-aware routing. May be null if token-aware routing is disabled.
- Since:
- 3.4
- See Also:
-
Statement.setRoutingKey(ByteBuffer)
-
getTimeout
- Returns:
- the command timeout. May be
negative
if not set. - Since:
- 3.0
- See Also:
-
Statement.setTimeout(Duration)
-
getSerialConsistencyLevel
- Returns:
- the serial
ConsistencyLevel
. - Since:
- 3.0
- See Also:
-
Statement.setSerialConsistencyLevel(ConsistencyLevel)
-
getTracing
- Returns:
- whether to enable tracing. May be null if not set.
-
equals
-
hashCode
public int hashCode()
-
getTimeout()
instead.