Client options
- Global
- This type is global
- Properties:
Name Type Description contactPoints Array<string>Array of addresses or host names of the nodes to add as contact points.
Contact points 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 will not be able to initialize correctly.
keyspace Stringpolicies Objectpolicies.loadBalancing LoadBalancingPolicyThe load balancing policy instance to be used to determine the coordinator per query.
policies.retry RetryPolicyThe retry policy.
policies.reconnection ReconnectionPolicyThe reconnection policy to be used.
policies.addressResolution AddressTranslatorThe address resolution policy.
queryOptions QueryOptionsDefault options for all queries.
pooling ObjectPooling options.
pooling.heartBeatInterval NumberThe amount of idle time in milliseconds that has to pass before the driver issues a request on an active connection to avoid idle time disconnections. Default: 30000.
pooling.coreConnectionsPerHost ObjectAssociative array containing amount of connections per host distance.
pooling.warmup BooleanDetermines if all connections to hosts in the local datacenter must be opened on connect. Default: false.
protocolOptions ObjectprotocolOptions.port NumberThe port to use to connect to the Cassandra host. If not set through this method, the default port (9042) will be used instead.
protocolOptions.maxSchemaAgreementWaitSeconds NumberThe maximum time in seconds to wait for schema agreement between nodes before returning from a DDL query. Default: 10.
protocolOptions.maxVersion NumberWhen set, it limits the maximum protocol version used to connect to the nodes. Useful for using the driver against a cluster that contains nodes with different major/minor versions of Cassandra.
socketOptions ObjectsocketOptions.connectTimeout NumberConnection timeout in milliseconds. Default: 5000.
socketOptions.defunctReadTimeoutThreshold NumberDetermines the amount of requests that simultaneously have to timeout before closing the connection. Default: 64.
socketOptions.keepAlive BooleanWhether to enable TCP keep-alive on the socket. Default: true.
socketOptions.keepAliveDelay NumberTCP keep-alive delay in milliseconds. Default: 0.
socketOptions.readTimeout NumberPer-host read timeout in milliseconds.
Please note that this is not the maximum time a call to
executemay have to wait; this is the maximum time that call will wait for one particular Cassandra host, but other hosts will be tried if one of them timeout. In other words, aexecutecall may theoretically wait up toreadTimeout * number_of_cassandra_hosts(though the total number of hosts tried for a given query also depends on the LoadBalancingPolicy in use).When setting this value, keep in mind the following:
- the timeout settings used on the Cassandra side (*_request_timeout_in_ms in cassandra.yaml) should be taken into account when picking a value for this read timeout. You should pick a value a couple of seconds greater than the Cassandra timeout settings.
- the read timeout is only approximate and only control the timeout to one Cassandra host, not the full query.
socketOptions.tcpNoDelay BooleanWhen set to true, it disables the Nagle algorithm. Default: true.
socketOptions.coalescingThreshold NumberBuffer length in bytes use by the write queue before flushing the frames. Default: 8000.
authProvider AuthProviderProvider to be used to authenticate to an auth-enabled cluster.
sslOptions ObjectClient-to-node ssl options, when set the driver will use the secure layer. You can specify cert, ca, … options named after the Node.js tls.connect options.
encoding Objectencoding.map functionMap constructor to use for Cassandra map
type encoding and decoding. If not set, it will default to Javascript Object with map keys as property names. encoding.set functionSet constructor to use for Cassandra set
type encoding and decoding. If not set, it will default to Javascript Array. encoding.copyBuffer BooleanDetermines if the network buffer should be copied for buffer based data types (blob, uuid, timeuuid and inet).
Setting it to true will cause that the network buffer is copied for each row value of those types, causing additional allocations but freeing the network buffer to be reused. Setting it to true is a good choice for cases where the Row and ResultSet returned by the queries are long-lived objects.
Setting it to false will cause less overhead and the reference of the network buffer to be maintained until the row / result set are de-referenced. Default: true.
encoding.useUndefinedAsUnset BooleanValid for Cassandra 2.2 and above. Determines that, if a parameter is set to
undefinedit should be encoded asunset.By default, ECMAScript
undefinedis encoded asnullin the driver. Cassandra 2.2 introduced the concept of unset. At driver level, you can set a parameter to unset using the fieldtypes.unset. Setting this flag to true allows you to use ECMAScript undefined as Cassandraunset.Default: true.