@@ -4,46 +4,43 @@ import scala.concurrent.duration._
4
4
5
5
/** Basic datastax driver configuration.
6
6
*
7
- * @param contactPoints The contact points to use for the initial connection to the cluster.
8
- * These are addresses of Cassandra nodes that the driver uses to discover the cluster topology.
9
- *
10
- * Only one contact point is required (the driver will retrieve the address of the other nodes
11
- * automatically), but it is usually a good idea to provide more than one contact point, because if
12
- * that single contact point is unavailable, the driver cannot initialize itself correctly.
13
- * This must be a list of strings with each contact point specified as "host:port". If the host is
14
- * a DNS name that resolves to multiple A-records, all the corresponding addresses will be used. Do
15
- * not use "localhost" as the host name (since it resolves to both IPv4 and IPv6 addresses on some
16
- * platforms).
17
- *
18
- * Note that Cassandra 3 and below requires all nodes in a cluster to share the same port (see
19
- * CASSANDRA-7544).
20
- * @param sessionName A name that uniquely identifies the driver instance created from this configuration. This is
21
- * used as a prefix for log messages and metrics.
22
- *
23
- * If this option is absent, the driver will generate an identifier composed of the letter 's'
24
- * followed by an incrementing counter. If you provide a different value, try to keep it short to
25
- * keep the logs readable. Also, make sure it is unique: reusing the same value will not break the
26
- * driver, but it will mix up the logs and metrics.
27
- * @param sessionKeyspace The name of the keyspace that the session should initially be connected to.
28
- *
29
- * This expects the same format as in a CQL query: case-sensitive names must be quoted.
30
- *
31
- * If this option is absent, the session won't be connected to any keyspace, and you'll have to
32
- * either qualify table names in your queries, or use the per-query keyspace feature available in
33
- * Cassandra 4 and above (see `com.datastax.oss.driver.api.core.session.Request.getKeyspace()`).
34
- * @param request This configures basic request properties such as timeout, page size etc.
35
- * @param loadBalancingPolicy The policy that decides the "query plan" for each query; that is, which nodes to try as
36
- * coordinators, and in which order.
37
- *
38
- * Overridable in a profile. Note that the driver creates as few instances as possible: if a
39
- * named profile inherits from the default profile, or if two sibling profiles have the exact
40
- * same configuration, they will share a single policy instance at runtime.
41
- * If there are multiple load balancing policies in a single driver instance, they work together
42
- * in the following way:
43
- * - each request gets a query plan from its profile's policy (or the default policy if the
44
- * request has no profile, or the profile does not override the policy).
45
- * - when the policies assign distances to nodes, the driver uses the closest assigned distance
46
- * for any given node.
7
+ * @param contactPoints
8
+ * The contact points to use for the initial connection to the cluster. These are addresses of Cassandra nodes that the driver uses to
9
+ * discover the cluster topology.
10
+ *
11
+ * Only one contact point is required (the driver will retrieve the address of the other nodes automatically), but it is usually a good
12
+ * idea to provide more than one contact point, because if that single contact point is unavailable, the driver cannot initialize itself
13
+ * 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
14
+ * multiple A-records, all the corresponding addresses will be used. Do not use "localhost" as the host name (since it resolves to both
15
+ * IPv4 and IPv6 addresses on some platforms).
16
+ *
17
+ * Note that Cassandra 3 and below requires all nodes in a cluster to share the same port (see CASSANDRA-7544).
18
+ * @param sessionName
19
+ * A name that uniquely identifies the driver instance created from this configuration. This is used as a prefix for log messages and
20
+ * metrics.
21
+ *
22
+ * If this option is absent, the driver will generate an identifier composed of the letter 's' followed by an incrementing counter. If you
23
+ * 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
24
+ * break the driver, but it will mix up the logs and metrics.
25
+ * @param sessionKeyspace
26
+ * The name of the keyspace that the session should initially be connected to.
27
+ *
28
+ * This expects the same format as in a CQL query: case-sensitive names must be quoted.
29
+ *
30
+ * 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,
31
+ * or use the per-query keyspace feature available in Cassandra 4 and above (see
32
+ * `com.datastax.oss.driver.api.core.session.Request.getKeyspace()`).
33
+ * @param request
34
+ * This configures basic request properties such as timeout, page size etc.
35
+ * @param loadBalancingPolicy
36
+ * The policy that decides the "query plan" for each query; that is, which nodes to try as coordinators, and in which order.
37
+ *
38
+ * Overridable in a profile. Note that the driver creates as few instances as possible: if a named profile inherits from the default
39
+ * profile, or if two sibling profiles have the exact same configuration, they will share a single policy instance at runtime. If there are
40
+ * multiple load balancing policies in a single driver instance, they work together in the following way:
41
+ * - 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
42
+ * not override the policy).
43
+ * - when the policies assign distances to nodes, the driver uses the closest assigned distance for any given node.
47
44
*/
48
45
final case class BasicConfig (
49
46
contactPoints : List [String ] = BasicConfig .Default .contactPoints,
@@ -60,38 +57,34 @@ object BasicConfig {
60
57
61
58
/** Request configuration.
62
59
*
63
- * @param timeout How long the driver waits for a request to complete. This is a global limit on the duration of
64
- * a `session.execute()` call, including any internal retries the driver might do.
65
- *
66
- * By default, this value is set pretty high to ensure that DDL queries don't time out, in order
67
- * to provide the best experience for new users trying the driver with the out-of-the-box
68
- * configuration.
69
- * For any serious deployment, we recommend that you use separate configuration profiles for DDL
70
- * and DML; you can then set the DML timeout much lower (down to a few milliseconds if needed).
71
- *
72
- * Note that, because timeouts are scheduled on the driver's timer thread, the duration specified
73
- * here must be greater than the timer tick duration defined by the
74
- * advanced.netty.timer.tick-duration setting (see below). If that is not the case, timeouts will
75
- * not be triggered as timely as desired.
76
- *
77
- * Overridable in a profile.
78
- * @param consistency The consistency level.
79
- * Overridable in a profile.
80
- * @param pageSize The page size. This controls how many rows will be retrieved simultaneously in a single
81
- * network roundtrip (the goal being to avoid loading too many results in memory at the same
82
- * time). If there are more results, additional requests will be used to retrieve them (either
83
- * automatically if you iterate with the sync API, or explicitly with the async API's
84
- * fetchNextPage method).
85
- *
86
- * If the value is 0 or negative, it will be ignored and the request will not be paged.
87
- *
88
- * Overridable in a profile.
89
- * @param serialConsistency The serial consistency level.
90
- * The allowed values are SERIAL and LOCAL_SERIAL.
91
- * Overridable in a profile.
92
- * @param defaultIdempotence The default idempotence of a request, that will be used for all `Request` instances where
93
- * `isIdempotent()` returns null.
94
- * Overridable in a profile.
60
+ * @param timeout
61
+ * How long the driver waits for a request to complete. This is a global limit on the duration of a `session.execute()` call, including
62
+ * any internal retries the driver might do.
63
+ *
64
+ * 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
65
+ * users trying the driver with the out-of-the-box configuration. For any serious deployment, we recommend that you use separate
66
+ * configuration profiles for DDL and DML; you can then set the DML timeout much lower (down to a few milliseconds if needed).
67
+ *
68
+ * Note that, because timeouts are scheduled on the driver's timer thread, the duration specified here must be greater than the timer tick
69
+ * duration defined by the advanced.netty.timer.tick-duration setting (see below). If that is not the case, timeouts will not be triggered
70
+ * as timely as desired.
71
+ *
72
+ * Overridable in a profile.
73
+ * @param consistency
74
+ * The consistency level. Overridable in a profile.
75
+ * @param pageSize
76
+ * The page size. This controls how many rows will be retrieved simultaneously in a single network roundtrip (the goal being to avoid
77
+ * loading too many results in memory at the same time). If there are more results, additional requests will be used to retrieve them
78
+ * (either automatically if you iterate with the sync API, or explicitly with the async API's fetchNextPage method).
79
+ *
80
+ * If the value is 0 or negative, it will be ignored and the request will not be paged.
81
+ *
82
+ * Overridable in a profile.
83
+ * @param serialConsistency
84
+ * The serial consistency level. The allowed values are SERIAL and LOCAL_SERIAL. Overridable in a profile.
85
+ * @param defaultIdempotence
86
+ * The default idempotence of a request, that will be used for all `Request` instances where `isIdempotent()` returns null. Overridable
87
+ * in a profile.
95
88
*/
96
89
final case class BasicRequestConfig (
97
90
timeout : Duration = BasicRequestConfig .Default .timeout,
@@ -108,20 +101,21 @@ object BasicRequestConfig {
108
101
109
102
/** The policy that decides the "query plan" for each query; that is, which nodes to try as coordinators, and in which order.
110
103
*
111
- * @param `class` The class of the policy. If it is not qualified, the driver assumes that it resides in the
112
- * package `com.datastax.oss.driver.internal.core.loadbalancing`.
113
- * @param localDatacenter The datacenter that is considered "local": the default policy will only include nodes from
114
- * this datacenter in its query plans.
104
+ * @param `class`
105
+ * The class of the policy. If it is not qualified, the driver assumes that it resides in the package
106
+ * `com.datastax.oss.driver.internal.core.loadbalancing`.
107
+ * @param localDatacenter
108
+ * The datacenter that is considered "local": the default policy will only include nodes from this datacenter in its query plans.
115
109
*
116
- * This option can only be absent if you specified no contact points: in that case, the driver
117
- * defaults to 127.0.0.1:9042, and that node's datacenter is used as the local datacenter.
110
+ * 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
111
+ * datacenter is used as the local datacenter.
118
112
*
119
- * As soon as you provide contact points (either through the configuration or through the cluster
120
- * builder), you must define the local datacenter explicitly, and initialization will fail if
121
- * this property is absent. In addition, all contact points should be from this datacenter;
122
- * warnings will be logged for nodes that are from a different one.
113
+ * As soon as you provide contact points (either through the configuration or through the cluster builder), you must define the local
114
+ * datacenter explicitly, and initialization will fail if this property is absent. In addition, all contact points should be from this
115
+ * datacenter; warnings will be logged for nodes that are from a different one.
123
116
*
124
- * @param filter A custom filter to include/exclude nodes.
117
+ * @param filter
118
+ * A custom filter to include/exclude nodes.
125
119
*/
126
120
final case class LoadBalancingPolicyConfig (
127
121
`class` : String = LoadBalancingPolicyConfig .Default .`class`,
@@ -135,12 +129,12 @@ object LoadBalancingPolicyConfig {
135
129
136
130
/** A custom filter to include/exclude nodes.
137
131
*
138
- * The predicate's `test(Node)` method will be invoked each time the policy processes a
139
- * topology or state change: if it returns false, the node will be set at distance IGNORED
140
- * (meaning the driver won't ever connect to it), and never included in any query plan.
132
+ * The predicate's `test(Node)` method will be invoked each time the policy processes a topology or state change: if it returns false, the
133
+ * node will be set at distance IGNORED (meaning the driver won't ever connect to it), and never included in any query plan.
141
134
*
142
- * @param `class` it must be the fully-qualified name of a class that implements `java.util.function.Predicate<Node>`,
143
- * and has a public constructor taking a single `DriverContext` argument.
135
+ * @param `class`
136
+ * it must be the fully-qualified name of a class that implements `java.util.function.Predicate<Node>`, and has a public constructor
137
+ * taking a single `DriverContext` argument.
144
138
*/
145
139
final case class FilterConfig (`class` : String )
146
140
0 commit comments