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