#  -*- text -*-
#
#  SQL driver configuration for Cassandra
#
#  Should be included inside of a SQL module's configuration section
#
# $Id: ec4e5951c2175d9fc92834a622989b8e1e370118 $
#
cassandra {
	# Consistency level, may be one of:
	#
	#   any          - A write must be written to the commit log and
	#		   memtable on all replica nodes in the cluster for that partition.
	#   one          - A write must be written to the commit log and
	#		   memtable of at least one replica node.
	#   two          - A write must be written to the commit log and memtable of at
	#		   least two replica nodes.
	#   three        - A write must be written to the commit log and memtable of at least
	#		   three replica nodes.
	#   quorum       - A write must be written to the commit log and memtable on a quorum
	#		   of replica nodes.
	#   all          - A write must be written to the commit log and memtable on all replica
	#		   nodes in the cluster for that partition.
	#   each_quorum  - Strong consistency. A write must be written to the commit log
	#		   and memtable on a quorum of replica nodes in all data centers.
	#   local_quorum - Strong consistency. A write must be written to the commit log and
	#		   memtable on a quorum of replica nodes in the same data center as
	#		   the coordinator node. Avoids latency of inter-data center communication.
	#   local_one    - A write must be sent to, and successfully acknowledged by, at least one
	#		   replica node in the local data center.
	consistency = 'quorum'

	# Protocol version (default 2).
#	protocol_version = 2

	# Number of connections to each server in each IO thread (default 1).
#	connections_per_host = 1

	# Number of IO threads (default 1).
#	io_threads = 1

	# Size of the the fixed size queue that stores pending requests (default 4096).
#	io_queue_size = 4096

	# The size of the the fixed size queue that stores events (default 4096).
#	event_queue_size = 4096

	# Use DC aware load balancing (enabled by default)
	load_balance_dc_aware {
		# Primary data centre to try first, must be set for other settings to be effective.
#		local_dc = 'datacenter1'

		# Number of hosts used at each remote dc (default 0).
#		hosts_per_remote_dc = 0

		# Allow remote hosts to be used if no local dc hosts are available and the
		# consistency level is 'local_one' or 'local_quorum' (default no).
#		allow_remote_dcs_for_local_cl = no
	}

	#
	#  Use latency aware request routing (default no, uncomment section to enable)
	#
#	latency_aware_routing {
#		# Controls how much worse the latency must be compared to the
#		# average latency of the best performing node before it penalized
#		# (default 2.0).
#		exclusion_threshold = 2.0
#
#		# Controls the weight given to older latencies when calculating the
#		# average latency of a node. A bigger scale will give more weight to older
#		# latency measurements (default 0.1).
#		scale = 0.1
#
#		# The amount of time (in seconds) a node is penalized by the policy before being
#		# given a second chance when the current average latency exceeds the calculated
#		# threshold (exclusion_threshold * best_average_latency) (default 10).
#		retry_period = 10
#
#		# The rate at which the best average latency is recomputed in seconds (default 0.1).
#		update_rate = 0.1
#
#		# The minimum number of measurements per-host required to be considered by
#		# the policy (default 50).
#		min_measured = 50
#	}

	# How often to send TCP keepalive in seconds (default is 0 - disabled)
#	tcp_keepalive = 0

	# Disable the TCP naggle algorithm (default no)
#	tcp_nodelay = no

	#
	#  Encrypt communications using TLS (default no, uncomment section to enable)
	#
#	tls {
#		ca_file = '/etc/ssl/certs/my_ca.crt'
#		certificate_file = '/etc/ssl/certs/private/client.crt'
#		private_key_file = '/etc/ssl/certs/private/client.key'
#		private_key_password = 'whatever'
#
#		# Whether we verify the server's certificate (default yes)
#		#   identity - Verify the certificate, and ensure the CN of the
#		#	       certificate matches the FQDN or IP address of the
#		#	       server.
#		#   yes      - Verify the certificate using ca_file
#		#   no       - Don't verify the certificate.
#		#
#		verify_cert = no
#	}
}
