SQL Driver: Cassandra¶
Driver name cassandra.
Driver for Apache Cassandra CQL server.
To compile support for this driver, you need to have DataStax C/C++ driver and headers installed.
Supported Options¶
- connect_timeout¶
Default:
5sValues: Millisecond Time
Connection timeout.
- debug_queries¶
Default:
noValues: Boolean
Whether to log CQL queries.
Note
This setting behaves differently than other boolean settings. The feature is enabled by presence of the keyword in connect string, so to disable this feature, you must remove the keyword completely.
- delete_consistency¶
Default:
local-quorumValues: Cassandra Consistency Values
Write consistency when deleting from the database.
See also
- delete_fallback_consistency¶
Default:
local-quorumValues: Cassandra Consistency Values
Write consistency when deleting from the database fails with primary consistency.
See also
- execution_retry_interval¶
Default:
0Values: Millisecond Time
If the driver supports speculative execution policy, configures constant speculative execution policy.
- execution_retry_times¶
Default:
0Values: Millisecond Time
If the driver supports speculative execution policy, configures constant speculative execution policy.
- heartbeat_interval¶
Default:
5sValues: Time
How often to send keepalive packets to cassandra nodes.
- idle_timeout¶
Default:
0Values: Millisecond Time
How long to idle before disconnecting.
- latency_aware_routing¶
Default:
noValues: Boolean
When turned on, latency-aware routing tracks the latency of queries to avoid sending new queries to poorly performing Cassandra nodes.
Note
The feature is enabled by presence of the keyword in connect string, so to disable this feature, you must remove the keyword completely.
- log_level¶
Default:
warnValues:
critical,error,warn,info,debug,trace
Driver log level.
- metrics¶
Default: <empty>
Values:
string
Path where to write JSON metrics.
See also
- num_threads¶
Default: <driver dependent>
Values: Unsigned integer
Set number of IO threads to handle query requests.
- page_size¶
Default:
-1Values: Unsigned integer
When a query returns many rows, it can be sometimes inefficient to return them as a single response message. Instead, the driver can break the results into pages which get returned as they are needed.
This setting controls the size of each page.
Set to
-1to disable.
- port¶
Default:
9042Values: Unsigned integer
CQL port to use.
- read_consistency¶
Default:
local-quorumValues: Cassandra Consistency Values
Read consistency.
See also
- read_fallback_consistency¶
Default:
local-quorumValues: Cassandra Consistency Values
Read consistency if primary consistency fails.
See also
- request_timeout¶
Default:
60sValues: Millisecond Time
How long to wait for a query to finish.
- ssl_ca¶
Default: <empty>
Values: String
Path to SSL certificate authority file to use to validate peer certificate.
- ssl_cert_file¶
Default: <empty>
Values: String
Path to a certificate file to use for authenticating against the remote server.
- ssl_private_key_file¶
Default: <empty>
Values: String
Path to private key matching
ssl_cert_fileto use for authenticating against the remote server.
- ssl_verify¶
Default:
noneValues:
none,cert,cert-ip,cert-dns
Configure the peer certificate validation method.
Options:
noneDisables validation.
certValidate that the certificate is valid.
cert-ipValidate that the certificate is valid and has Common Name or Subject Alternate Name for the IP address.
cert-dnsValidate that the certificate is valid and has Common Name or Subject Alternate Name that matches PTR resource record for the server’s IP address.
- version¶
Default: Depends on driver version.
Values:
3,4,5
Cassandra protocol version to use. It is good idea to specify this to avoid warnings about version handshake if the driver supports a higher protocol version than the server.
Note
If you want to use server-side prepared statements, you need to use at least
4.
- warn_timeout¶
Default:
5sValues: Millisecond Time
Emit warning if query takes longer than this.
- write_consistency¶
Default:
local-quorumValues: Cassandra Consistency Values
Write consistency when updating or inserting to the database.
See also
- write_fallback_consistency¶
Default:
local-quorumValues: Cassandra Consistency Values
Write consistency when updating or inserting to the database fails with primary consistency.
See also
Cassandra Consistency Values¶
Consistency levels in Cassandra can be configured to manage availability versus data accuracy.
Read Consistency¶
For read consistency the following values are supported:
anyNot supported for reads.
local-serialAllows reading the current (and possibly uncommitted) state of data without proposing a new addition or update. If a
SERIALread finds an uncommitted transaction in progress, it will commit the transaction as part of the read. Local serial is confined to datacenter.serialAllows reading the current (and possibly uncommitted) state of data without proposing a new addition or update. If a
SERIALread finds an uncommitted transaction in progress, it will commit the transaction as part of the read.oneReturns a response from the closest replica, as determined by the snitch.
twoReturns the most recent data from two of the closest replicas.
threeReturns the most recent data from three of the closest replicas.
local-quorumReturns the record after a quorum of replicas in the current datacenter as the coordinator has reported.
quorumReturns the record after a quorum of replicas from all datacenters has responded.
each-quorumNot supported for reads.
allReturns the record after all replicas have responded. The read operation will fail if a replica does not respond.
Write/Delete Consistency¶
For write and delete consistency the following values are supported:
anyAt least one node must succeed in the operation.
local-serialNot supported for writes.
serialNot supported for writes.
oneOperation must be at least in commit log and one memory table of one replica.
twoOperation must be at least in commit log and one memory table of two replicas.
threeOperation must be at least in commit log and one memory table of three replicas.
local-quorumA write must be written to the commit log and memory table on a quorum of replica nodes in the same datacenter as the coordinator.
quorumA write must be written to the commit log and memory table on a quorum of replica nodes across all datacenters.
each-quorumA write must be written to the commit log and memory table on a quorum of replica nodes in each datacenter.
allA write must be written to the commit log and memtable on all replica nodes in the cluster for that partition.
