com.avast.sst.datastax.config

Type members

Classlikes

final case class AddressTranslatorConfig(`class`: String)

The address translator to use to convert the addresses sent by Cassandra nodes into ones that the driver uses to connect.

The address translator to use to convert the addresses sent by Cassandra nodes into ones that the driver uses to connect.

This is only needed if the nodes are not directly reachable from the driver (for example, the driver is in a different network region and needs to use a public IP, or it connects through a proxy).

Companion:
object
final case class AdvancedConfig(connection: ConnectionConfig, reconnectOnInit: Boolean, reconnectionPolicy: ReconnectionPolicyConfig, retryPolicy: RetryPolicyConfig, speculativeExecutionPolicy: SpeculativeExecutionPolicyConfig, authProvider: Option[AuthProviderConfig], timestampGenerator: TimestampGeneratorConfig, requestTracker: RequestTrackerConfig, throttler: ThrottlerConfig, nodeStateListener: NodeStateListenerConfig, schemaChangeListener: SchemaChangeListenerConfig, addressTranslator: AddressTranslatorConfig, resolveContactPoints: Boolean, protocol: ProtocolConfig, request: AdvancedRequestConfig, metrics: MetricsConfig, heartbeat: HeartbeatConfig, socket: SocketConfig, metadata: MetadataConfig, controlConnection: ControlConnectionConfig, preparedStatements: PreparedStatementsConfig, netty: NettyConfig, coalescer: CoalescerConfig)

Advanced datastax driver configuration

Advanced datastax driver configuration

Value parameters:
addressTranslator

The address translator to use to convert the addresses sent by Cassandra nodes into ones that the driver uses to connect. By default com.datastax.oss.driver.internal.core.addresstranslation.PassThroughAddressTranslator is used.

authProvider

if None no authentication will occur.

coalescer

The component that coalesces writes on the connections.

connection

Configures query connection.

controlConnection

Configures dedicated administrative connection.

heartbeat

Heartbeat configuration to check if node is alive.

metadata

Metadata about the Cassandra cluster.

metrics

Metrics configuration. Disabled by default.

netty

Netty configuration which is used internally by driver.

nodeStateListener

A session-wide component that listens for node state changes. By default com.datastax.oss.driver.internal.core.metadata.NoopNodeStateListener is used.

preparedStatements

Prepared statements configuration.

protocol

The native protocol to use which defines the format of the binary messages between driver and Cassandra.

reconnectOnInit

Whether to schedule reconnection attempts if all contact points are unreachable on the first initialization attempt. If this is true, the driver will retry according to the reconnection policy. The SessionBuilder.build() call -- or the future returned by SessionBuilder.buildAsync() -- won't complete until a contact point has been reached. If this is false and no contact points are available, the driver will fail.

reconnectionPolicy

The policy that controls how often the driver tries to re-establish connections to down nodes.

request

Request configuration.

requestTracker

A session-wide component that tracks the outcome of requests. By default com.datastax.oss.driver.internal.core.trackerNoopRequestTracker is used.

resolveContactPoints

Whether to resolve the addresses passed to Basic.contactPoints. If this is true, addresses are created with InetSocketAddress(String, int): the host name will be resolved the first time, and the driver will use the resolved IP address for all subsequent connection attempts. If this is false, addresses are created with InetSocketAddress.createUnresolved(): the host name will be resolved again every time the driver opens a new connection. This is useful for containerized environments where DNS records are more likely to change over time (note that the JVM and OS have their own DNS caching mechanisms, so you might need additional configuration beyond the driver).

retryPolicy

The policy that controls if the driver retries requests that have failed on one node.

schemaChangeListener

A session-wide component that listens for node state changes. By default com.datastax.oss.driver.internal.core.metadata.schema.NoopSchemaChangeListener is used.

socket

Socket configuration.

speculativeExecutionPolicy

The policy that controls if the driver pre-emptively tries other nodes if a node takes too long to respond.

throttler

A session-wide component that controls the rate at which requests are executed. By default PassThroughRequestThrottler is used.

timestampGenerator

The generator that assigns a microsecond timestamp to each request.

Companion:
object
Companion:
class
final case class AdvancedRequestConfig(warnIfSetKeyspace: Boolean, trace: TraceConfig, logWarnings: Boolean)
Value parameters:
logWarnings

Whether logging of server warnings generated during query execution should be disabled by the driver.

warnIfSetKeyspace

Whether a warning is logged when a request (such as a CQL USE ...) changes the active keyspace.

Companion:
object
final case class AuthProviderConfig(`class`: String, username: String, password: String)

The component that handles authentication on each new connection.

The component that handles authentication on each new connection.

Value parameters:
`class`

custom class that implements AuthProvider and has a public constructor with a DriverContext argument

final case class BasicConfig(contactPoints: List[String], sessionName: Option[String], sessionKeyspace: Option[String], configReloadInterval: Duration, request: BasicRequestConfig, loadBalancingPolicy: LoadBalancingPolicyConfig)

Basic datastax driver configuration.

Basic datastax driver configuration.

Value parameters:
contactPoints

The contact points to use for the initial connection to the cluster. These are addresses of Cassandra nodes that the driver uses to discover the cluster topology. Only one contact point is required (the driver will retrieve the address of the other nodes automatically), but it is usually a good idea to provide more than one contact point, because if that single contact point is unavailable, the driver cannot initialize itself correctly. This must be a list of strings with each contact point specified as "host:port". If the host is a DNS name that resolves to multiple A-records, all the corresponding addresses will be used. Do not use "localhost" as the host name (since it resolves to both IPv4 and IPv6 addresses on some platforms). Note that Cassandra 3 and below requires all nodes in a cluster to share the same port (see CASSANDRA-7544).

loadBalancingPolicy

The policy that decides the "query plan" for each query; that is, which nodes to try as coordinators, and in which order. Overridable in a profile. Note that the driver creates as few instances as possible: if a named profile inherits from the default profile, or if two sibling profiles have the exact same configuration, they will share a single policy instance at runtime. If there are multiple load balancing policies in a single driver instance, they work together in the following way:

  • each request gets a query plan from its profile's policy (or the default policy if the request has no profile, or the profile does not override the policy).
  • when the policies assign distances to nodes, the driver uses the closest assigned distance for any given node.
request

This configures basic request properties such as timeout, page size etc.

sessionKeyspace

The name of the keyspace that the session should initially be connected to. This expects the same format as in a CQL query: case-sensitive names must be quoted. If this option is absent, the session won't be connected to any keyspace, and you'll have to either qualify table names in your queries, or use the per-query keyspace feature available in Cassandra 4 and above (see com.datastax.oss.driver.api.core.session.Request.getKeyspace()).

sessionName

A name that uniquely identifies the driver instance created from this configuration. This is used as a prefix for log messages and metrics. If this option is absent, the driver will generate an identifier composed of the letter 's' followed by an incrementing counter. If you provide a different value, try to keep it short to keep the logs readable. Also, make sure it is unique: reusing the same value will not break the driver, but it will mix up the logs and metrics.

Companion:
object
Companion:
class
final case class BasicRequestConfig(timeout: Duration, consistency: ConsistencyLevel, pageSize: Int, serialConsistency: ConsistencyLevel, defaultIdempotence: Boolean)

Request configuration.

Request configuration.

Value parameters:
consistency

The consistency level. Overridable in a profile.

defaultIdempotence

The default idempotence of a request, that will be used for all Request instances where isIdempotent() returns null. Overridable in a profile.

pageSize

The page size. This controls how many rows will be retrieved simultaneously in a single network roundtrip (the goal being to avoid loading too many results in memory at the same time). If there are more results, additional requests will be used to retrieve them (either automatically if you iterate with the sync API, or explicitly with the async API's fetchNextPage method). If the value is 0 or negative, it will be ignored and the request will not be paged. Overridable in a profile.

serialConsistency

The serial consistency level. The allowed values are SERIAL and LOCAL_SERIAL. Overridable in a profile.

timeout

How long the driver waits for a request to complete. This is a global limit on the duration of a session.execute() call, including any internal retries the driver might do. By default, this value is set pretty high to ensure that DDL queries don't time out, in order to provide the best experience for new users trying the driver with the out-of-the-box configuration. For any serious deployment, we recommend that you use separate configuration profiles for DDL and DML; you can then set the DML timeout much lower (down to a few milliseconds if needed). Note that, because timeouts are scheduled on the driver's timer thread, the duration specified here must be greater than the timer tick duration defined by the advanced.netty.timer.tick-duration setting (see below). If that is not the case, timeouts will not be triggered as timely as desired. Overridable in a profile.

Companion:
object
Companion:
class
final case class CassandraDatastaxDriverConfig(basic: BasicConfig, advanced: AdvancedConfig, profiles: List[ProfileConfig])

Configuration for Cassandra Datastax Driver.

Configuration for Cassandra Datastax Driver.

final case class CoalescerConfig(rescheduleInterval: Duration)

The component that coalesces writes on the connections. This is exposed mainly to facilitate tuning during development. You shouldn't have to adjust this.

The component that coalesces writes on the connections. This is exposed mainly to facilitate tuning during development. You shouldn't have to adjust this.

Value parameters:
rescheduleInterval

The reschedule interval.

Companion:
object
Companion:
class
final case class ConnectionConfig(connectTimeout: Duration, initQueryTimeout: Duration, setKeyspaceTimeout: Duration, localPool: PoolConfig, remotePool: PoolConfig, maxRequestsPerConnection: Int, maxOrphanRequests: Int, warnOnInitError: Boolean)

Configure query connection properties.

Configure query connection properties.

Value parameters:
initQueryTimeout

The timeout to use for internal queries that run as part of the initialization process. If this timeout fires, the initialization of the connection will fail. If this is the first connection ever, the driver will fail to initialize as well, otherwise it will retry the connection later.

localPool

The driver maintains a connection pool to each node

maxOrphanRequests

The maximum number of "orphaned" requests before a connection gets closed automatically.

maxRequestsPerConnection

The maximum number of requests that can be executed concurrently on a connection. This must be between 1 and 32768.

remotePool

The driver maintains a connection pool to each node

setKeyspaceTimeout

The timeout to use when the driver changes the keyspace on a connection at runtime.

warnOnInitError

Whether to log non-fatal errors when the driver tries to open a new connection.

Companion:
object
Companion:
class
sealed abstract class ConsistencyLevel

The consistency level of a request

The consistency level of a request

Companion:
object
Companion:
class
final case class ControlConnectionConfig(timeout: Duration, schemaAgreement: SchemaAgreementConfig)
Companion:
object
final case class CqlMessagesConfig(highestLatency: Duration, significantDigits: Int, refreshInterval: Duration)
final case class CqlRequestsConfig(highestLatency: Duration, significantDigits: Int, refreshInterval: Duration)

Extra metrics configuration

Extra metrics configuration

Value parameters:
highestLatency

The largest latency that we expect to record.

refreshInterval

The interval at which percentile data is refreshed.

significantDigits

The number of significant decimal digits to which internal structures will maintain value resolution and separation (for example, 3 means that recordings up to 1 second will be recorded with a resolution of 1 millisecond or better). This must be between 0 and 5. If the value is out of range, it defaults to 3 and a warning is logged.

final case class DebouncerConfig(window: Duration, maxEvents: Int)

Protects against bursts of schema updates (for example when a client issues a sequence of DDL queries), by coalescing them into a single update.

Protects against bursts of schema updates (for example when a client issues a sequence of DDL queries), by coalescing them into a single update.

Value parameters:
maxEvents

The maximum number of refreshes that can accumulate. If this count is reached, a refresh is done immediately and the window is reset.

window

How long the driver waits to apply a refresh. If another refresh is requested within that time, the window is reset and a single refresh will be triggered when it ends. Debouncing may be disabled by setting the window to 0 or max-events to 1 (this is highly discouraged for schema refreshes).

Companion:
object
Companion:
class
final case class DelayConfig(highestLatency: Duration, significantDigits: Int, refreshInterval: Duration)

Throttling delay metric.

Throttling delay metric.

final case class DriftWarningConfig(threshold: Duration, interval: Duration)

Configure warn logging when timestamp drifts.

Configure warn logging when timestamp drifts.

Value parameters:
interval

How often the warning will be logged if timestamps keep drifting above the threshold.

threshold

How far in the future timestamps are allowed to drift before the warning is logged. If it is undefined or set to 0, warnings are disabled.

Companion:
object
Companion:
class
final case class FilterConfig(`class`: String)

A custom filter to include/exclude nodes.

A custom filter to include/exclude nodes.

The predicate's test(Node) method will be invoked each time the policy processes a topology or state change: if it returns false, the node will be set at distance IGNORED (meaning the driver won't ever connect to it), and never included in any query plan.

Value parameters:
`class`

it must be the fully-qualified name of a class that implements java.util.function.Predicate<Node>, and has a public constructor taking a single DriverContext argument.

final case class GroupConfig(size: Int, shutdown: ShutdownConfig)

The event loop group used for I/O operations (reading and writing to Cassandra nodes).

The event loop group used for I/O operations (reading and writing to Cassandra nodes).

Value parameters:
shutdown

The options to shut down the event loop group gracefully when the driver closes. If a task gets submitted during the quiet period, it is accepted and the quiet period starts over. The timeout limits the overall shutdown time.

size

The number of threads. If this is set to 0, the driver will use Runtime.getRuntime().availableProcessors() * 2.

Companion:
object
Companion:
class
final case class HeartbeatConfig(interval: Duration, timeout: Duration)

If a connection stays idle for that duration (no reads), the driver sends a dummy message on it to make sure it's still alive. If not, the connection is trashed and replaced.

If a connection stays idle for that duration (no reads), the driver sends a dummy message on it to make sure it's still alive. If not, the connection is trashed and replaced.

Value parameters:
interval

The heartbeat interval

timeout

How long the driver waits for the response to a heartbeat. If this timeout fires, the heartbeat is considered failed.

Companion:
object
Companion:
class
final case class LoadBalancingPolicyConfig(`class`: String, localDatacenter: Option[String], filter: Option[FilterConfig])

The policy that decides the "query plan" for each query; that is, which nodes to try as coordinators, and in which order.

The policy that decides the "query plan" for each query; that is, which nodes to try as coordinators, and in which order.

Value parameters:
`class`

The class of the policy. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.loadbalancing.

filter

A custom filter to include/exclude nodes.

localDatacenter

The datacenter that is considered "local": the default policy will only include nodes from this datacenter in its query plans. This option can only be absent if you specified no contact points: in that case, the driver defaults to 127.0.0.1:9042, and that node's datacenter is used as the local datacenter. As soon as you provide contact points (either through the configuration or through the cluster builder), you must define the local datacenter explicitly, and initialization will fail if this property is absent. In addition, all contact points should be from this datacenter; warnings will be logged for nodes that are from a different one.

Companion:
object
final case class LogsConfig(successEnabled: Option[Boolean], errorEnabled: Option[Boolean], slow: Option[SlowConfig], maxQueryLength: Option[Int], showValues: Option[Boolean], maxValueLength: Option[Int], maxValues: Option[Int], showStackTraces: Option[Boolean])

Parameters for RequestLogger.

Parameters for RequestLogger.

Value parameters:
errorEnabled

Whether to log failed requests.

maxQueryLength

The maximum length of the query string in the log message. If it is longer than that, it will be truncated.

maxValueLength

The maximum length for bound values in the log message. If the formatted representation of a value is longer than that, it will be truncated.

maxValues

The maximum number of bound values to log. If a request has more values, the list of values will be truncated.

showStackTraces

Whether to log stack traces for failed queries. If this is disabled, the log will just include the exception's string representation (generally the class name and message).

showValues

Whether to log bound values in addition to the query string.

slow

Slow requests logging.

successEnabled

Whether to log successful requests.

final case class MetadataConfig(debouncer: TopologyEventDebouncerConfig, schema: SchemaConfig, tokenMap: TokenMapConfig)

Metadata

Metadata

Value parameters:
debouncer

Debouncing to smoothen out oscillations if conflicting events are sent out in short bursts.

schema

Options relating to schema metadata.

tokenMap

Whether token metadata (Cluster.getMetadata.getTokenMap) is enabled.

Companion:
object
Companion:
class
final case class MetricsConfig(session: Option[SessionConfig], node: Option[NodeConfig])

Metrics configuration

Metrics configuration

Value parameters:
node

The node-level metrics (all disabled by default).

session

The session-level metrics (all disabled by default).

Companion:
object
Companion:
class
final case class NettyConfig(daemon: Boolean, ioGroup: GroupConfig, adminGroup: GroupConfig, timer: TimerConfig)

Options related to the Netty event loop groups used internally by the driver.

Options related to the Netty event loop groups used internally by the driver.

Value parameters:
adminGroup

The event loop group used for admin tasks not related to request I/O (handle cluster events, refresh metadata, schedule reconnections, etc.) By default, threads in this group are named after the session name, "-admin-" and an incrementing counter, for example "s0-admin-0".

daemon

Whether the threads created by the driver should be daemon threads. This will apply to the threads in io-group, admin-group, and the timer thread.

ioGroup

The event loop group used for I/O operations (reading and writing to Cassandra nodes). By default, threads in this group are named after the session name, "-io-" and an incrementing counter, for example "s0-io-0".

timer

The timer used for scheduling request timeouts and speculative executions By default, this thread is named after the session name and "-timer-0", for example "s0-timer-0".

Companion:
object
Companion:
class
final case class NodeConfig(enabled: List[Int], cqlRequests: Option[CqlMessagesConfig])

Node-level metric.

Node-level metric.

Value parameters:
cqlRequests

Required: if the 'cql-messages' metric is enabled

enabled

node-level metrics

final case class NodeStateListenerConfig(classes: List[String])

A session-wide component that listens for node state changes. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.metadata.

A session-wide component that listens for node state changes. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.metadata.

The driver provides a single no-op implementation out of the box: NoopNodeStateListener. You can also specify a custom class that implements NodeStateListener and has a public constructor with a DriverContext argument.

Companion:
object
final case class PoolConfig(size: Int)

The driver maintains a connection pool to each node, according to the distance assigned to it by the load balancing policy

The driver maintains a connection pool to each node, according to the distance assigned to it by the load balancing policy

Value parameters:
size

The number of connections in the pool

Companion:
object
object PoolConfig
Companion:
class
final case class PreparedStatementsConfig(prepareOnAllNodes: Boolean, reprepareOnUp: ReprepareOnUpConfig)
Value parameters:
prepareOnAllNodes

Overridable in a profile.

Companion:
object
final case class ProfileAdvancedConfig(request: ProfileAdvancedRequestConfig, retryPolicy: RetryPolicyConfig, speculativeExecutionPolicy: SpeculativeExecutionPolicyConfig, timestampGenerator: TimestampGeneratorConfig, preparedStatements: ProfilePreparedStatementsConfig)
Companion:
object
final case class ProfileAdvancedRequestConfig(trace: TraceConfig, logWarnings: Boolean)
Companion:
object
final case class ProfileBasicConfig(request: BasicRequestConfig, loadBalancingPolicy: LoadBalancingPolicyConfig)
Companion:
object
Companion:
class
final case class ProfileConfig(name: String, basic: ProfileBasicConfig, advanced: ProfileAdvancedConfig)

Profile configuration holding overridable properties.

Profile configuration holding overridable properties.

final case class ProfilePreparedStatementsConfig(prepareOnAllNodes: Boolean)
Companion:
object
final case class ProtocolConfig(version: Option[String], compression: Option[String], maxFrameLength: Int)

Protocol for query connection.

Protocol for query connection.

Value parameters:
compression

The name of the algorithm used to compress protocol frames.

maxFrameLength

The maximum length of the frames supported by the driver in megabytes. Beyond that limit, requests will fail with an exception.

version

The native protocol version to use. If this option is absent, the driver looks up the versions of the nodes at startup (by default in "system.peers.release_version"), and chooses the highest common protocol version.

Companion:
object
Companion:
class
final case class ReconnectionPolicyConfig(`class`: String, baseDelay: Duration, maxDelay: Option[Duration])

The policy that controls how often the driver tries to re-establish connections to down nodes.

The policy that controls how often the driver tries to re-establish connections to down nodes.

Value parameters:
baseDelay

Reconnection policy starts with the base delay.

class

The class of the policy. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.connection.

maxDelay

Reconnection policy increases delay up to the max delay.

Companion:
object
final case class ReprepareOnUpConfig(enabled: Boolean, checkSystemTable: Boolean, maxStatements: Int, maxParallelism: Int, timeout: Duration)

How the driver replicates prepared statements on a node that just came back up or joined the cluster.

How the driver replicates prepared statements on a node that just came back up or joined the cluster.

Value parameters:
checkSystemTable

Whether to check system.prepared_statements on the target node before repreparing. This table exists since CASSANDRA-8831 (merged in 3.10). It stores the statements already prepared on the node, and preserves them across restarts. Checking the table first avoids repreparing unnecessarily, but the cost of the query is not always worth the improvement, especially if the number of statements is low. If the table does not exist, or the query fails for any other reason, the error is ignored and the driver proceeds to reprepare statements according to the other parameters.

enabled

Whether the driver tries to prepare on new nodes at all. The reason why you might want to disable it is to optimize reconnection time when you believe nodes often get marked down because of temporary network issues, rather than the node really crashing. In that case, the node still has prepared statements in its cache when the driver reconnects, so re-preparing is redundant. On the other hand, if that assumption turns out to be wrong and the node had really restarted, its prepared statement cache is empty (before CASSANDRA-8831), and statements need to be re-prepared on the fly the first time they get executed; this causes a performance penalty (one extra roundtrip to resend the query to prepare, and another to retry the execution).

maxParallelism

The maximum number of concurrent requests when repreparing.

maxStatements

The maximum number of statements that should be reprepared. 0 or a negative value means no limit.

timeout

The request timeout. This applies both to querying the system.prepared_statements table (if relevant), and the prepare requests themselves.

Companion:
object
Companion:
class
final case class RequestTrackerConfig(classes: List[String], logs: Option[LogsConfig])

A session-wide component that tracks the outcome of requests.

A session-wide component that tracks the outcome of requests.

Value parameters:
class

The class of the tracker. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.tracker.

logs

Parameters for RequestLogger

Companion:
object
Companion:
class
final case class RetryPolicyConfig(`class`: String)

The policy that controls if the driver retries requests that have failed on one node

The policy that controls if the driver retries requests that have failed on one node

Value parameters:
class

The class of the policy. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.retry.

Companion:
object
Companion:
class
final case class SchemaAgreementConfig(interval: Duration, timeout: Duration, warnOnFailure: Boolean)

Due to the distributed nature of Cassandra, schema changes made on one node might not be immediately visible to others. Under certain circumstances, the driver waits until all nodes agree on a common schema version (namely: before a schema refresh, before repreparing all queries on a newly up node, and before completing a successful schema-altering query). To do so, it queries system tables to find out the schema version of all nodes that are currently UP. If all the versions match, the check succeeds, otherwise it is retried periodically, until a given timeout.

Due to the distributed nature of Cassandra, schema changes made on one node might not be immediately visible to others. Under certain circumstances, the driver waits until all nodes agree on a common schema version (namely: before a schema refresh, before repreparing all queries on a newly up node, and before completing a successful schema-altering query). To do so, it queries system tables to find out the schema version of all nodes that are currently UP. If all the versions match, the check succeeds, otherwise it is retried periodically, until a given timeout.

A schema agreement failure is not fatal, but it might produce unexpected results (for example, getting an "unconfigured table" error for a table that you created right before, just because the two queries went to different coordinators).

Note that schema agreement never succeeds in a mixed-version cluster (it would be challenging because the way the schema version is computed varies across server versions); the assumption is that schema updates are unlikely to happen during a rolling upgrade anyway.

Value parameters:
interval

The interval between each attempt.

timeout

The timeout after which schema agreement fails. If this is set to 0, schema agreement is skipped and will always fail.

warnOnFailure

Whether to log a warning if schema agreement fails. You might want to change this if you've set the timeout to 0.

Companion:
object
final case class SchemaChangeListenerConfig(classes: List[String])

A session-wide component that listens for node state changes. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.metadata.schema.

A session-wide component that listens for node state changes. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.metadata.schema.

The driver provides a single no-op implementation out of the box: NoopSchemaChangeListener.

You can also specify a custom class that implements SchemaChangeListener and has a public constructor with a DriverContext argument.

Companion:
object
final case class SchemaConfig(enabled: Boolean, refreshedKeyspaces: List[String], requestTimeout: Duration, requestPageSize: Int, debouncer: DebouncerConfig)

Options relating to schema metadata (Cluster.getMetadata.getKeyspaces). This metadata is exposed by the driver for informational purposes, and is also necessary for token-aware routing.

Options relating to schema metadata (Cluster.getMetadata.getKeyspaces). This metadata is exposed by the driver for informational purposes, and is also necessary for token-aware routing.

Value parameters:
debouncer

Protects against bursts of schema updates.

enabled

Whether schema metadata is enabled. If this is false, the schema will remain empty, or to the last known value.

refreshedKeyspaces

The list of keyspaces for which schema and token metadata should be maintained. If this property is absent or empty, all existing keyspaces are processed.

requestPageSize

The page size for the requests to the schema tables.

requestTimeout

The timeout for the requests to the schema tables.

Companion:
object
Companion:
class
final case class SessionConfig(enabled: List[Int], cqlRequests: Option[CqlRequestsConfig], throttling: Option[ThrottlingConfig])

The session-level metrics (all disabled by default).

The session-level metrics (all disabled by default).

Value parameters:
cqlRequests

Extra configuration (for the metrics that need it). Required if the 'cql-requests' metric is enabled

enabled

The session-level metrics (all disabled by default).

throttling

Configures request throttling metrics..

final case class ShutdownConfig(quietPeriod: Int, timeout: Int, unit: String)

The options to shut down the event loop group gracefully when the driver closes. If a task gets submitted during the quiet period, it is accepted and the quiet period starts over.

The options to shut down the event loop group gracefully when the driver closes. If a task gets submitted during the quiet period, it is accepted and the quiet period starts over.

The timeout limits the overall shutdown time.

Companion:
object
Companion:
class
final case class SlowConfig(threshold: Option[Duration], enabled: Option[Boolean])

Strategy to classify request as "slow".

Strategy to classify request as "slow".

Value parameters:
enabled

Whether to log slow requests.

threshold

The threshold to classify a successful request as "slow". If this is unset, all successful requests will be considered as normal.

final case class SocketConfig(tcpNoDelay: Boolean, keepAlive: Option[Boolean], reuseAddress: Option[Boolean], lingerInterval: Option[Int], receiveBufferSize: Option[Int], sendBufferSize: Option[Int])

Socket configuration.

Socket configuration.

Value parameters:
keepAlive

All other socket options are unset by default. The actual value depends on the underlying Netty transport.

lingerInterval

Sets the linger interval. If the value is zero or greater, then it represents a timeout value, in seconds; if the value is negative, it means that this option is disabled.

receiveBufferSize

Sets a hint to the size of the underlying buffers for incoming network I/O.

reuseAddress

Whether or not to allow address reuse.

sendBufferSize

Sets a hint to the size of the underlying buffers for outgoing network I/O.

tcpNoDelay

Whether or not to disable the Nagle algorithm. By default, this option is set to true (Nagle disabled), because the driver has its own internal message coalescing algorithm.

Companion:
object
Companion:
class
final case class SpeculativeExecutionPolicyConfig(`class`: String, maxExecutions: Option[Int], delay: Option[Duration])

The policy that controls if the driver preemptively tries other nodes if a node takes too long to respond.

The policy that controls if the driver preemptively tries other nodes if a node takes too long to respond.

Value parameters:
class

The class of the policy. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.specex.

delay

The delay between each execution. 0 is allowed, and will result in all executions being sent simultaneously when the request starts.

maxExecutions

The maximum number of executions (including the initial, non-speculative execution). This must be at least one.

Companion:
object
final case class ThrottlerConfig(`class`: String, maxQueueSize: Option[Int], maxConcurrentRequests: Option[Int], maxRequestsPerSecond: Option[Int], drainInterval: Option[Duration])

A session-wide component that controls the rate at which requests are executed.

A session-wide component that controls the rate at which requests are executed.

Value parameters:
class

The class of the throttler. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.session.throttling.

drainInterval

How often the throttler attempts to dequeue requests. Only used by RateLimitingRequestThrottler.

maxConcurrentRequests

The maximum number of requests that are allowed to execute in parallel. Only used by ConcurrencyLimitingRequestThrottler.

maxQueueSize

The maximum number of requests that can be enqueued when the throttling threshold is exceeded. Beyond that size, requests will fail with a RequestThrottlingException.

maxRequestsPerSecond

The maximum allowed request rate. Only used by RateLimitingRequestThrottler.

Companion:
object
Companion:
class
final case class ThrottlingConfig(delay: Option[DelayConfig])

How long requests are being throttled

How long requests are being throttled

Value parameters:
delay

This is the time between the start of the session.execute() call, and the moment when the throttler allows the request to proceed. Required: if the 'throttling.delay' metric is enabled

final case class TimerConfig(tickDuration: Duration, ticksPerWheel: Int)

The timer used for scheduling request timeouts and speculative executions.

The timer used for scheduling request timeouts and speculative executions.

Value parameters:
tickDuration

The timer tick duration. This is how frequent the timer should wake up to check for timed-out tasks or speculative executions. Lower resolution (i.e. longer durations) will leave more CPU cycles for running I/O operations at the cost of precision of exactly when a request timeout will expire or a speculative execution will run. Higher resolution (i.e. shorter durations) will result in more precise request timeouts and speculative execution scheduling, but at the cost of CPU cycles taken from I/O operations, which could lead to lower overall I/O throughput. The default value is 100 milliseconds, which is a comfortable value for most use cases. However if you are using more agressive timeouts or speculative execution delays, then you should lower the timer tick duration as well, so that its value is always equal to or lesser than the timeout duration and/or speculative execution delay you intend to use. Note for Windows users: avoid setting this to aggressive values, that is, anything under 100 milliseconds; doing so is known to cause extreme CPU usage. Also, the tick duration must be a multiple of 10 under Windows; if that is not the case, it will be automatically rounded down to the nearest multiple of 10 (e.g. 99 milliseconds will be rounded down to 90 milliseconds).

ticksPerWheel

Number of ticks in a Timer wheel. The underlying implementation uses Netty's HashedWheelTimer, which uses hashes to arrange the timeouts. This effectively controls the size of the timer wheel.

Companion:
object
Companion:
class
final case class TimestampGeneratorConfig(`class`: String, driftWarning: DriftWarningConfig, forceJavaClock: Boolean)

The generator that assigns a microsecond timestamp to each request.

The generator that assigns a microsecond timestamp to each request.

Value parameters:
class

The class of the generator. If it is not qualified, the driver assumes that it resides in the package com.datastax.oss.driver.internal.core.time.

driftWarning

configure timestamp drift logging

forceJavaClock

Whether to force the driver to use Java's millisecond-precision system clock. If this is false, the driver will try to access the microsecond-precision OS clock via native calls (and fallback to the Java one if the native calls fail).

Companion:
object
final case class TokenMapConfig(enabled: Boolean)

Whether token metadata (Cluster.getMetadata.getTokenMap) is enabled. This metadata is exposed by the driver for informational purposes, and is also necessary for token-aware routing. If this is false, it will remain empty, or to the last known value. Note that its computation requires information about the schema; therefore if schema metadata is disabled or filtered to a subset of keyspaces, the token map will be incomplete, regardless of the value of this property.

Whether token metadata (Cluster.getMetadata.getTokenMap) is enabled. This metadata is exposed by the driver for informational purposes, and is also necessary for token-aware routing. If this is false, it will remain empty, or to the last known value. Note that its computation requires information about the schema; therefore if schema metadata is disabled or filtered to a subset of keyspaces, the token map will be incomplete, regardless of the value of this property.

final case class TopologyEventDebouncerConfig(window: Duration, maxEvents: Int)

The debouncer helps smoothen out oscillations if conflicting events are sent out in short bursts.

The debouncer helps smoothen out oscillations if conflicting events are sent out in short bursts.

Value parameters:
maxEvents

The maximum number of events that can accumulate. If this count is reached, the events are delivered immediately and the time window is reset. This avoids holding events indefinitely if the window keeps getting reset.

window

How long the driver waits to propagate an event. If another event is received within that time, the window is reset and a batch of accumulated events will be delivered. Debouncing may be disabled by setting the window to 0 or max-events to 1 (not recommended).

Companion:
object
final case class TraceConfig(attempts: Int, interval: Duration, consistency: ConsistencyLevel)

Trace configuration

Trace configuration

Value parameters:
attempts

How many times the driver will attempt to fetch the query if it is not ready yet.

consistency

The consistency level to use for trace queries.

interval

The interval between each attempt.

Companion:
object
Companion:
class

Value members

Concrete fields

val ConnectTimeout: Duration
val InitQueryTimeout: Duration
val RequestTimeout: Duration