package config
- Alphabetic
- By Inheritance
- config
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class AddressTranslatorConfig(class: String) extends Product with Serializable
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).
- final case class AdvancedConfig(connection: ConnectionConfig = AdvancedConfig.Default.connection, reconnectOnInit: Boolean = AdvancedConfig.Default.reconnectOnInit, reconnectionPolicy: ReconnectionPolicyConfig = AdvancedConfig.Default.reconnectionPolicy, retryPolicy: RetryPolicyConfig = AdvancedConfig.Default.retryPolicy, speculativeExecutionPolicy: SpeculativeExecutionPolicyConfig = AdvancedConfig.Default.speculativeExecutionPolicy, authProvider: Option[AuthProviderConfig] = AdvancedConfig.Default.authProvider, timestampGenerator: TimestampGeneratorConfig = AdvancedConfig.Default.timestampGenerator, requestTracker: RequestTrackerConfig = AdvancedConfig.Default.requestTracker, throttler: ThrottlerConfig = AdvancedConfig.Default.throttler, nodeStateListener: NodeStateListenerConfig = AdvancedConfig.Default.nodeStateListener, schemaChangeListener: SchemaChangeListenerConfig = AdvancedConfig.Default.schemaChangeListener, addressTranslator: AddressTranslatorConfig = AdvancedConfig.Default.addressTranslator, resolveContactPoints: Boolean = AdvancedConfig.Default.resolveContactPoints, protocol: ProtocolConfig = AdvancedConfig.Default.protocol, request: AdvancedRequestConfig = AdvancedConfig.Default.request, metrics: MetricsConfig = AdvancedConfig.Default.metrics, heartbeat: HeartbeatConfig = AdvancedConfig.Default.heartbeat, socket: SocketConfig = AdvancedConfig.Default.socket, metadata: MetadataConfig = AdvancedConfig.Default.metadata, controlConnection: ControlConnectionConfig = AdvancedConfig.Default.controlConnection, preparedStatements: PreparedStatementsConfig = AdvancedConfig.Default.preparedStatements, netty: NettyConfig = AdvancedConfig.Default.netty, coalescer: CoalescerConfig = AdvancedConfig.Default.coalescer) extends Product with Serializable
Advanced datastax driver configuration
Advanced datastax driver configuration
- connection
Configures query connection.
- 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 bySessionBuilder.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.
- retryPolicy
The policy that controls if the driver retries requests that have failed on one node.
- speculativeExecutionPolicy
The policy that controls if the driver pre-emptively tries other nodes if a node takes too long to respond.
- authProvider
if
None
no authentication will occur.- timestampGenerator
The generator that assigns a microsecond timestamp to each request.
- requestTracker
A session-wide component that tracks the outcome of requests. By default
com.datastax.oss.driver.internal.core.trackerNoopRequestTracker
is used.- throttler
A session-wide component that controls the rate at which requests are executed. By default
PassThroughRequestThrottler
is used.- nodeStateListener
A session-wide component that listens for node state changes. By default
com.datastax.oss.driver.internal.core.metadata.NoopNodeStateListener
is used.- schemaChangeListener
A session-wide component that listens for node state changes. By default
com.datastax.oss.driver.internal.core.metadata.schema.NoopSchemaChangeListener
is used.- 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.- resolveContactPoints
Whether to resolve the addresses passed to
Basic.contactPoints
. If this is true, addresses are created withInetSocketAddress(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 withInetSocketAddress.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).- protocol
The native protocol to use which defines the format of the binary messages between driver and Cassandra.
- request
Request configuration.
- metrics
Metrics configuration. Disabled by default.
- heartbeat
Heartbeat configuration to check if node is alive.
- socket
Socket configuration.
- metadata
Metadata about the Cassandra cluster.
- controlConnection
Configures dedicated administrative connection.
- preparedStatements
Prepared statements configuration.
- netty
Netty configuration which is used internally by driver.
- coalescer
The component that coalesces writes on the connections.
- final case class AdvancedRequestConfig(warnIfSetKeyspace: Boolean, trace: TraceConfig, logWarnings: Boolean) extends Product with Serializable
- warnIfSetKeyspace
Whether a warning is logged when a request (such as a CQL
USE ...
) changes the active keyspace.- logWarnings
Whether logging of server warnings generated during query execution should be disabled by the driver.
- final case class AuthProviderConfig(class: String, username: String, password: String) extends Product with Serializable
The component that handles authentication on each new connection.
- final case class BasicConfig(contactPoints: List[String] = BasicConfig.Default.contactPoints, sessionName: Option[String] = BasicConfig.Default.sessionName, sessionKeyspace: Option[String] = BasicConfig.Default.sessionKeyspace, configReloadInterval: Duration = BasicConfig.Default.configReloadInterval, request: BasicRequestConfig = BasicConfig.Default.request, loadBalancingPolicy: LoadBalancingPolicyConfig = BasicConfig.Default.loadBalancingPolicy) extends Product with Serializable
Basic datastax driver configuration.
Basic datastax driver configuration.
- 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).
- 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.
- 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()
).- request
This configures basic request properties such as timeout, page size etc.
- 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.
- final case class BasicRequestConfig(timeout: Duration = BasicRequestConfig.Default.timeout, consistency: ConsistencyLevel = BasicRequestConfig.Default.consistency, pageSize: Int = BasicRequestConfig.Default.pageSize, serialConsistency: ConsistencyLevel = BasicRequestConfig.Default.serialConsistency, defaultIdempotence: Boolean = BasicRequestConfig.Default.defaultIdempotence) extends Product with Serializable
Request configuration.
Request configuration.
- 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.- consistency
The consistency level. 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.
- defaultIdempotence
The default idempotence of a request, that will be used for all
Request
instances whereisIdempotent()
returns null. Overridable in a profile.
- final case class CassandraDatastaxDriverConfig(basic: BasicConfig, advanced: AdvancedConfig = AdvancedConfig.Default, profiles: List[ProfileConfig] = List.empty) extends Product with Serializable
Configuration for Cassandra Datastax Driver.
- final case class CoalescerConfig(rescheduleInterval: Duration = CoalescerConfig.Default.rescheduleInterval) extends Product with Serializable
The component that coalesces writes on the connections.
The component that coalesces writes on the connections. This is exposed mainly to facilitate tuning during development. You shouldn't have to adjust this.
- rescheduleInterval
The reschedule interval.
- final case class ConnectionConfig(connectTimeout: Duration = ConnectionConfig.Default.connectTimeout, initQueryTimeout: Duration = ConnectionConfig.Default.initQueryTimeout, setKeyspaceTimeout: Duration = ConnectionConfig.Default.setKeyspaceTimeout, localPool: PoolConfig = ConnectionConfig.Default.localPool, remotePool: PoolConfig = ConnectionConfig.Default.remotePool, maxRequestsPerConnection: Int = ConnectionConfig.Default.maxRequestsPerConnection, maxOrphanRequests: Int = ConnectionConfig.Default.maxOrphanRequests, warnOnInitError: Boolean = ConnectionConfig.Default.warnOnInitError) extends Product with Serializable
Configure query connection properties.
Configure query connection properties.
- 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.
- setKeyspaceTimeout
The timeout to use when the driver changes the keyspace on a connection at runtime.
- localPool
The driver maintains a connection pool to each node
- remotePool
The driver maintains a connection pool to each node
- maxRequestsPerConnection
The maximum number of requests that can be executed concurrently on a connection. This must be between 1 and 32768.
- maxOrphanRequests
The maximum number of "orphaned" requests before a connection gets closed automatically.
- warnOnInitError
Whether to log non-fatal errors when the driver tries to open a new connection.
- sealed abstract class ConsistencyLevel extends AnyRef
The consistency level of a request
- final case class ContinuousCqlRequests(highestLatency: Duration = 120.seconds, lowestLatency: Duration = 10.millisecond, significantDigits: Int = 3, refreshInterval: Duration = 5.minutes) extends Product with Serializable
- final case class ControlConnectionConfig(timeout: Duration, schemaAgreement: SchemaAgreementConfig) extends Product with Serializable
- final case class CqlMessagesConfig(highestLatency: Duration = 3.seconds, lowestLatency: Duration = 1.millisecond, significantDigits: Int = 3, refreshInterval: Duration = 5.minutes) extends Product with Serializable
- final case class CqlRequestsConfig(highestLatency: Duration = 3.seconds, lowestLatency: Duration = 1.millisecond, significantDigits: Int = 3, refreshInterval: Duration = 5.minutes) extends Product with Serializable
Extra metrics configuration
Extra metrics configuration
- highestLatency
The largest latency that we expect to record.\
- lowestLatency
The lowest latency that we expect to record.
- 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.
- refreshInterval
The interval at which percentile data is refreshed.
- final case class DebouncerConfig(window: Duration = DebouncerConfig.Default.window, maxEvents: Int = DebouncerConfig.Default.maxEvents) extends Product with Serializable
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.
- 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).
- maxEvents
The maximum number of refreshes that can accumulate. If this count is reached, a refresh is done immediately and the window is reset.
- final case class DelayConfig(highestLatency: Duration = 3.seconds, lowestLatency: Duration = 1.millisecond, significantDigits: Int = 3, refreshInterval: Duration = 5.minutes) extends Product with Serializable
Throttling delay metric.
- final case class DriftWarningConfig(threshold: Duration, interval: Duration) extends Product with Serializable
Configure warn logging when timestamp drifts.
Configure warn logging when timestamp drifts.
- 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.
- interval
How often the warning will be logged if timestamps keep drifting above the threshold.
- final case class FilterConfig(class: String) extends Product with Serializable
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. - final case class GraphMessagesConfig(highestLatency: Duration = 3.seconds, lowestLatency: Duration = 1.millisecond, significantDigits: Int = 3, refreshInterval: Duration = 5.minutes) extends Product with Serializable
- final case class GraphRequests(highestLatency: Duration = 12.seconds, lowestLatency: Duration = 1.millisecond, significantDigits: Int = 3, refreshInterval: Duration = 5.minutes) extends Product with Serializable
- final case class GroupConfig(size: Int, shutdown: ShutdownConfig) extends Product with Serializable
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).
- size
The number of threads. If this is set to 0, the driver will use
Runtime.getRuntime().availableProcessors() * 2
.- 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.
- final case class HeartbeatConfig(interval: Duration, timeout: Duration) extends Product with Serializable
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 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.
- 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.
- final case class IdGeneratorConfig(class: String = "DefaultMetricIdGenerator", prefix: Option[String] = None) extends Product with Serializable
Metric ID generator configuration.
Metric ID generator configuration.
The driver ships with two built-in implementations:
- DefaultMetricIdGenerator: generates identifiers composed solely of (unique) metric names; It is mostly suitable for use with metrics libraries that do not support tags, like Dropwizard.
- TaggingMetricIdGenerator: generates identifiers composed of name and tags. It is mostly suitable for use with metrics libraries that support tags, like Micrometer or MicroProfile Metrics.
- prefix
An optional prefix to prepend to each generated metric name. The prefix should not start nor end with a dot or any other path separator; the following are two valid examples: "cassandra" or "myapp.prod.cassandra".
- final case class LoadBalancingPolicyConfig(class: String = LoadBalancingPolicyConfig.Default.`class`, localDatacenter: Option[String] = LoadBalancingPolicyConfig.Default.localDatacenter, filter: Option[FilterConfig] = LoadBalancingPolicyConfig.Default.filter) extends Product with Serializable
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.
- 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.
- filter
A custom filter to include/exclude nodes.
- 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]) extends Product with Serializable
Parameters for RequestLogger.
Parameters for RequestLogger.
- successEnabled
Whether to log successful requests.
- errorEnabled
Whether to log failed requests.
- slow
Slow requests logging.
- maxQueryLength
The maximum length of the query string in the log message. If it is longer than that, it will be truncated.
- showValues
Whether to log bound values in addition to the query string.
- 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).
- final case class MetadataConfig(debouncer: TopologyEventDebouncerConfig = MetadataConfig.Default.debouncer, schema: SchemaConfig = MetadataConfig.Default.schema, tokenMap: TokenMapConfig = MetadataConfig.Default.tokenMap) extends Product with Serializable
Metadata
Metadata
- 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.
- final case class MetricsConfig(factory: Option[MetricsFactoryConfig], idGenerator: Option[IdGeneratorConfig], session: Option[SessionConfig], node: Option[NodeConfig]) extends Product with Serializable
Metrics configuration
Metrics configuration
- factory
Metrics Factory configuration.
- idGenerator
This section configures how metric ids are generated. A metric id is a unique combination of a metric name and metric tags.
- session
The session-level metrics (all disabled by default).
- node
The node-level metrics (all disabled by default).
- final case class MetricsFactoryConfig(class: String = "DefaultMetricsFactory") extends Product with Serializable
Metrics Factory configuration.
- final case class NettyConfig(daemon: Boolean = NettyConfig.Default.daemon, ioGroup: GroupConfig = NettyConfig.Default.ioGroup, adminGroup: GroupConfig = NettyConfig.Default.adminGroup, timer: TimerConfig = NettyConfig.Default.timer) extends Product with Serializable
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.
- 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".
- 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".
- 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".
- final case class NodeConfig(enabled: List[String], cqlMessages: Option[CqlMessagesConfig], graphMessages: Option[GraphMessagesConfig], expireAfter: Duration = 1.hour) extends Product with Serializable
Node-level metric.
Node-level metric.
- enabled
node-level metrics
- cqlMessages
Required: if the 'cql-messages' metric is enabled
- graphMessages
Required: if the 'graph-messages' metric is enabled, and Dropwizard or Micrometer is used.
- expireAfter
The time after which the node level metrics will be evicted. The lowest allowed value is 5 minutes. If you try to set it lower, the driver will log a warning and use 5 minutes.
- final case class NodeStateListenerConfig(classes: List[String]) extends Product with Serializable
A session-wide component that listens for node state changes.
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. - final case class PoolConfig(size: Int) extends Product with Serializable
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
- size
The number of connections in the pool
- final case class PreparedStatementsConfig(prepareOnAllNodes: Boolean = PreparedStatementsConfig.Default.prepareOnAllNodes, reprepareOnUp: ReprepareOnUpConfig = PreparedStatementsConfig.Default.reprepareOnUp) extends Product with Serializable
- prepareOnAllNodes
Overridable in a profile.
- final case class ProfileAdvancedConfig(request: ProfileAdvancedRequestConfig = ProfileAdvancedConfig.Default.request, retryPolicy: RetryPolicyConfig = ProfileAdvancedConfig.Default.retryPolicy, speculativeExecutionPolicy: SpeculativeExecutionPolicyConfig = ProfileAdvancedConfig.Default.speculativeExecutionPolicy, timestampGenerator: TimestampGeneratorConfig = ProfileAdvancedConfig.Default.timestampGenerator, preparedStatements: ProfilePreparedStatementsConfig = ProfileAdvancedConfig.Default.preparedStatements) extends Product with Serializable
- final case class ProfileAdvancedRequestConfig(trace: TraceConfig = ProfileAdvancedRequestConfig.Default.trace, logWarnings: Boolean = ProfileAdvancedRequestConfig.Default.logWarnings) extends Product with Serializable
- final case class ProfileBasicConfig(request: BasicRequestConfig = ProfileBasicConfig.Default.request, loadBalancingPolicy: LoadBalancingPolicyConfig = ProfileBasicConfig.Default.loadBalancingPolicy) extends Product with Serializable
- final case class ProfileConfig(name: String, basic: ProfileBasicConfig = ProfileBasicConfig.Default, advanced: ProfileAdvancedConfig = ProfileAdvancedConfig.Default) extends Product with Serializable
Profile configuration holding overridable properties.
- final case class ProfilePreparedStatementsConfig(prepareOnAllNodes: Boolean) extends Product with Serializable
- final case class ProtocolConfig(version: Option[String], compression: Option[String], maxFrameLength: Int) extends Product with Serializable
Protocol for query connection.
Protocol for query connection.
- 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.
- 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.
- final case class ReconnectionPolicyConfig(class: String = ReconnectionPolicyConfig.Default.`class`, baseDelay: Duration = ReconnectionPolicyConfig.Default.baseDelay, maxDelay: Option[Duration] = ReconnectionPolicyConfig.Default.maxDelay) extends Product with Serializable
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.
- 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
.- baseDelay
Reconnection policy starts with the base delay.
- maxDelay
Reconnection policy increases delay up to the max delay.
- final case class ReprepareOnUpConfig(enabled: Boolean = ReprepareOnUpConfig.Default.enabled, checkSystemTable: Boolean = ReprepareOnUpConfig.Default.checkSystemTable, maxStatements: Int = ReprepareOnUpConfig.Default.maxStatements, maxParallelism: Int = ReprepareOnUpConfig.Default.maxParallelism, timeout: Duration = ReprepareOnUpConfig.Default.timeout) extends Product with Serializable
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.
- 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).
- 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.- maxStatements
The maximum number of statements that should be reprepared. 0 or a negative value means no limit.
- maxParallelism
The maximum number of concurrent requests when repreparing.
- timeout
The request timeout. This applies both to querying the system.prepared_statements table (if relevant), and the prepare requests themselves.
- final case class RequestTrackerConfig(classes: List[String] = List("com.datastax.oss.driver.internal.core.tracker.NoopRequestTracker"), logs: Option[LogsConfig]) extends Product with Serializable
A session-wide component that tracks the outcome of requests.
A session-wide component that tracks the outcome of requests.
- logs
Parameters for RequestLogger
- final case class RetryPolicyConfig(class: String) extends Product with Serializable
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
- 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
.
- final case class SchemaAgreementConfig(interval: Duration = SchemaAgreementConfig.Default.interval, timeout: Duration = SchemaAgreementConfig.Default.timeout, warnOnFailure: Boolean = SchemaAgreementConfig.Default.warnOnFailure) extends Product with Serializable
Due to the distributed nature of Cassandra, schema changes made on one node might not be immediately visible to others.
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.
- 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.
- final case class SchemaChangeListenerConfig(classes: List[String]) extends Product with Serializable
A session-wide component that listens for node state changes.
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. - final case class SchemaConfig(enabled: Boolean = SchemaConfig.Default.enabled, refreshedKeyspaces: List[String] = SchemaConfig.Default.refreshedKeyspaces, requestTimeout: Duration = SchemaConfig.Default.requestTimeout, requestPageSize: Int = SchemaConfig.Default.requestPageSize, debouncer: DebouncerConfig = SchemaConfig.Default.debouncer) extends Product with Serializable
Options relating to schema metadata (Cluster.getMetadata.getKeyspaces).
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.
- 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.
- requestTimeout
The timeout for the requests to the schema tables.
- requestPageSize
The page size for the requests to the schema tables.
- debouncer
Protects against bursts of schema updates.
- final case class SessionConfig(enabled: List[String] = List.empty, cqlRequests: Option[CqlRequestsConfig], throttling: Option[ThrottlingConfig], continuousCqlRequests: Option[ContinuousCqlRequests], graphRequests: Option[GraphRequests]) extends Product with Serializable
The session-level metrics (all disabled by default).
The session-level metrics (all disabled by default).
- enabled
The session-level metrics (all disabled by default).
- cqlRequests
Extra configuration (for the metrics that need it). Required if the 'cql-requests' metric is enabled
- throttling
Configures request throttling metrics.
- continuousCqlRequests
Required: if the 'continuous-cql-requests' metric is enabled, and Dropwizard or Micrometer is used.
- graphRequests
Required: if the 'graph-requests' metric is enabled, and Dropwizard or Micrometer is used.
- final case class ShutdownConfig(quietPeriod: Int, timeout: Int, unit: String) extends Product with Serializable
The options to shut down the event loop group gracefully when the driver closes.
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.
- final case class SlowConfig(threshold: Option[Duration], enabled: Option[Boolean]) extends Product with Serializable
Strategy to classify request as "slow".
Strategy to classify request as "slow".
- threshold
The threshold to classify a successful request as "slow". If this is unset, all successful requests will be considered as normal.
- enabled
Whether to log slow requests.
- final case class SocketConfig(tcpNoDelay: Boolean, keepAlive: Option[Boolean], reuseAddress: Option[Boolean], lingerInterval: Option[Int], receiveBufferSize: Option[Int], sendBufferSize: Option[Int]) extends Product with Serializable
Socket configuration.
Socket configuration.
- 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.
- keepAlive
All other socket options are unset by default. The actual value depends on the underlying Netty transport.
- reuseAddress
Whether or not to allow address reuse.
- 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.
- sendBufferSize
Sets a hint to the size of the underlying buffers for outgoing network I/O.
- final case class SpeculativeExecutionPolicyConfig(class: String, maxExecutions: Option[Int], delay: Option[Duration]) extends Product with Serializable
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.
- 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
.- maxExecutions
The maximum number of executions (including the initial, non-speculative execution). This must be at least one.
- delay
The delay between each execution. 0 is allowed, and will result in all executions being sent simultaneously when the request starts.
- final case class ThrottlerConfig(class: String, maxQueueSize: Option[Int], maxConcurrentRequests: Option[Int], maxRequestsPerSecond: Option[Int], drainInterval: Option[Duration]) extends Product with Serializable
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.
- 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.
- 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.
- maxConcurrentRequests
The maximum number of requests that are allowed to execute in parallel. Only used by ConcurrencyLimitingRequestThrottler.
- maxRequestsPerSecond
The maximum allowed request rate. Only used by RateLimitingRequestThrottler.
- drainInterval
How often the throttler attempts to dequeue requests. Only used by RateLimitingRequestThrottler.
- final case class ThrottlingConfig(delay: Option[DelayConfig]) extends Product with Serializable
How long requests are being throttled
How long requests are being throttled
- 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 = TimerConfig.Default.tickDuration, ticksPerWheel: Int = TimerConfig.Default.ticksPerWheel) extends Product with Serializable
The timer used for scheduling request timeouts and speculative executions.
The timer used for scheduling request timeouts and speculative executions.
- 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.
- final case class TimestampGeneratorConfig(class: String = TimestampGeneratorConfig.Default.`class`, driftWarning: DriftWarningConfig = TimestampGeneratorConfig.Default.driftWarning, forceJavaClock: Boolean = TimestampGeneratorConfig.Default.forceJavaClock) extends Product with Serializable
The generator that assigns a microsecond timestamp to each request.
The generator that assigns a microsecond timestamp to each request.
- 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).
- final case class TokenMapConfig(enabled: Boolean) extends Product with Serializable
Whether token metadata (Cluster.getMetadata.getTokenMap) is
enabled
.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 = TopologyEventDebouncerConfig.Default.window, maxEvents: Int = TopologyEventDebouncerConfig.Default.maxEvents) extends Product with Serializable
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.
- 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).
- 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.
- final case class TraceConfig(attempts: Int, interval: Duration, consistency: ConsistencyLevel) extends Product with Serializable
Trace configuration
Trace configuration
- attempts
How many times the driver will attempt to fetch the query if it is not ready yet.
- interval
The interval between each attempt.
- consistency
The consistency level to use for trace queries.
Value Members
- val ConnectTimeout: Duration
- val InitQueryTimeout: Duration
- val RequestPageSize: Int
- val RequestTimeout: Duration
- object AddressTranslatorConfig extends Serializable
- object AdvancedConfig extends Serializable
- object AdvancedRequestConfig extends Serializable
- object BasicConfig extends Serializable
- object BasicRequestConfig extends Serializable
- object CoalescerConfig extends Serializable
- object ConnectionConfig extends Serializable
- object ConsistencyLevel
- object ControlConnectionConfig extends Serializable
- object DebouncerConfig extends Serializable
- object DriftWarningConfig extends Serializable
- object GroupConfig extends Serializable
- object HeartbeatConfig extends Serializable
- object LoadBalancingPolicyConfig extends Serializable
- object MetadataConfig extends Serializable
- object MetricsConfig extends Serializable
- object NettyConfig extends Serializable
- object NodeStateListenerConfig extends Serializable
- object PoolConfig extends Serializable
- object PreparedStatementsConfig extends Serializable
- object ProfileAdvancedConfig extends Serializable
- object ProfileAdvancedRequestConfig extends Serializable
- object ProfileBasicConfig extends Serializable
- object ProfilePreparedStatementsConfig extends Serializable
- object ProtocolConfig extends Serializable
- object ReconnectionPolicyConfig extends Serializable
- object ReprepareOnUpConfig extends Serializable
- object RequestTrackerConfig extends Serializable
- object RetryPolicyConfig extends Serializable
- object SchemaAgreementConfig extends Serializable
- object SchemaChangeListenerConfig extends Serializable
- object SchemaConfig extends Serializable
- object ShutdownConfig extends Serializable
- object SocketConfig extends Serializable
- object SpeculativeExecutionPolicyConfig extends Serializable
- object ThrottlerConfig extends Serializable
- object TimerConfig extends Serializable
- object TimestampGeneratorConfig extends Serializable
- object TopologyEventDebouncerConfig extends Serializable
- object TraceConfig extends Serializable