-
Notifications
You must be signed in to change notification settings - Fork 888
/
Copy pathreference.conf
2356 lines (2163 loc) · 110 KB
/
reference.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Reference configuration for the Java Driver for Apache Cassandra®.
#
# Unless you use a custom mechanism to load your configuration (see
# SessionBuilder.withConfigLoader), all the values declared here will be used as defaults. You can
# place your own `application.conf` in the classpath to override them.
#
# Options are classified into two categories:
# - basic: what is most likely to be customized first when kickstarting a new application.
# - advanced: more elaborate tuning options, or "expert"-level customizations.
#
# This file is in HOCON format, see https://github.com/typesafehub/config/blob/master/HOCON.md.
datastax-java-driver {
# BASIC OPTIONS ----------------------------------------------------------------------------------
# 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).
#
# Contact points can also be provided programmatically when you build a cluster instance. If both
# are specified, they will be merged. If both are absent, the driver will default to
# 127.0.0.1:9042.
#
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
// basic.contact-points = [ "127.0.0.1:9042", "127.0.0.2:9042" ]
# 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.
#
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
// basic.session-name = my_session
# 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 (note that
# the quotes must be escaped in HOCON format). For example:
# session-keyspace = case_insensitive_name
# session-keyspace = \"CaseSensitiveName\"
#
# 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 Request.getKeyspace()).
#
# This can also be provided programatically in CqlSessionBuilder.
#
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
// basic.session-keyspace = my_keyspace
# How often the driver tries to reload the configuration.
#
# To disable periodic reloading, set this to 0.
#
# Required: yes (unless you pass a different ConfigLoader to the session builder).
# Modifiable at runtime: yes, the new value will be used after the next time the configuration
# gets reloaded.
# Overridable in a profile: no
basic.config-reload-interval = 5 minutes
basic.request {
# How long the driver waits for a request to complete. This is a global limit on the duration of
# a session.execute() call, including any internal retries the driver might do.
#
# 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 users trying the driver with the out-of-the-box
# configuration.
# For any serious deployment, we recommend that you use separate configuration profiles for DDL
# and DML; you can then set the DML timeout much lower (down to a few milliseconds if needed).
#
# Note that, because timeouts are scheduled on the driver's timer thread, the duration specified
# here must be greater than the timer tick duration defined by the
# advanced.netty.timer.tick-duration setting (see below). If that is not the case, timeouts will
# not be triggered as timely as desired.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
timeout = 2 seconds
# The consistency level.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
consistency = LOCAL_ONE
# The page size. This controls how many rows will be retrieved simultaneously in a single
# network roundtrip (the goal being to avoid loading too many results in memory at the same
# time). If there are more results, additional requests will be used to retrieve them (either
# automatically if you iterate with the sync API, or explicitly with the async API's
# fetchNextPage method).
# If the value is 0 or negative, it will be ignored and the request will not be paged.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
page-size = 5000
# The serial consistency level.
# The allowed values are SERIAL and LOCAL_SERIAL.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
serial-consistency = SERIAL
# The default idempotence of a request, that will be used for all `Request` instances where
# `isIdempotent()` returns null.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
default-idempotence = false
}
# The policy that decides the "query plan" for each query; that is, which nodes to try as
# coordinators, and in which order.
#
# Required: yes
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: yes. 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.
basic.load-balancing-policy {
# The class of the policy. If it is not qualified, the driver assumes that it resides in one of
# the following packages:
# - com.datastax.oss.driver.internal.core.loadbalancing.
# - com.datastax.dse.driver.internal.core.loadbalancing.
#
# The driver provides three implementations out of the box:
#
# - `DefaultLoadBalancingPolicy`: should almost always be used; it requires a local datacenter
# to be specified either programmatically when creating the session, or via the configuration
# option: datastax-java-driver.basic.load-balancing-policy.local-datacenter. It can also
# use a highly efficient slow replica avoidance mechanism, which is by default enabled – see
# the option: datastax-java-driver.basic.load-balancing-policy.slow-replica-avoidance.
# - `DcInferringLoadBalancingPolicy`: similar to `DefaultLoadBalancingPolicy`, but does not
# require a local datacenter to be defined, in which case it will attempt to infer the local
# datacenter from the provided contact points, if possible; if that fails, it will throw an
# error during session initialization. This policy is intended mostly for ETL tools and
# should not be used by normal applications.
# - `BasicLoadBalancingPolicy`: similar to `DefaultLoadBalancingPolicy`, but does not have
# the slow replica avoidance mechanism. More importantly, it is the only policy capable of
# operating without local datacenter defined, in which case it will consider nodes in the
# cluster in a datacenter-agnostic way. Beware that this could cause spikes in
# cross-datacenter traffic! This policy is provided mostly as a starting point for users
# wishing to implement their own load balancing policy; it should not be used as is in normal
# applications.
#
# You can also specify a custom class that implements LoadBalancingPolicy and has a public
# constructor with two arguments: the DriverContext and a String representing the profile name.
class = DefaultLoadBalancingPolicy
# The datacenter that is considered "local": the default policy will only include nodes from
# this datacenter in its query plans.
#
# When using the default policy, 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 datacenter is
# used as the local datacenter. As soon as you provide contact points (either through the
# configuration or through the session builder), you must define the local datacenter
# explicitly, and initialization will fail if this property is absent. In addition, all contact
# points should be from this datacenter; warnings will be logged for nodes that are from a
# different one.
#
# This can also be specified programmatically with SessionBuilder.withLocalDatacenter. If both
# are specified, the programmatic value takes precedence.
// local-datacenter = datacenter1
# The class of a custom node distance evaluator.
#
# This option is not required; if present, it must be the fully-qualified name of a class that
# implements `com.datastax.oss.driver.api.core.loadbalancing.NodeDistanceEvaluator`, and has a
# public constructor taking two arguments: the DriverContext and a String representing the
# profile name.
#
# Alternatively, you can pass an instance of your distance evaluator to
# CqlSession.builder().withNodeDistanceEvaluator(). In that case, this option will be ignored.
#
# The evaluator will be invoked each time the policy processes a topology or state change. The
# evaluator's `evaluateDistance` method will be called with the node affected by the change, and
# the local datacenter name (or null if none is defined). If it returns a non-null distance, the
# policy will suggest that distance for the node; if the function returns null, the policy will
# will assign a default distance instead, based on its internal algorithm for computing node
# distances.
// evaluator.class=
# DEPRECATED. Use evaluator.class instead (see above). If both evaluator.class and filter.class
# are defined, the former wins.
#
# A custom filter to include/exclude nodes.
#
# This option is not required; if present, it must be the fully-qualified name of a class that
# implements `java.util.function.Predicate<Node>`, and has a public constructor taking two
# arguments: the DriverContext and a String representing the profile name.
#
# Alternatively, you can pass an instance of your filter to
# CqlSession.builder().withNodeFilter(). In that case, this option will be ignored.
#
# The predicate's `test(Node)` method will be invoked each time the policy processes a
# topology or state change: if it returns false, the node will be set at distance IGNORED
# (meaning the driver won't ever connect to it), and never included in any query plan.
// filter.class=
# Whether to enable the slow replica avoidance mechanism in DefaultLoadBalancingPolicy.
#
# The default policy always moves replicas first in the query plan (if routing information can
# be determined for the current request). However:
# - if this option is true, it also applies a custom algorithm that takes the responsiveness and
# uptime of each replica into account to order them among each other;
# - if this option is false, replicas are simply shuffled.
#
# If this option is not defined, the driver defaults to true.
slow-replica-avoidance = true
}
basic.cloud {
# The location of the cloud secure bundle used to connect to DataStax Apache Cassandra as a
# service.
# This setting must be a valid URL.
# If the protocol is not specified, it is implicitly assumed to be the `file://` protocol,
# in which case the value is expected to be a valid path on the local filesystem.
# For example, `/a/path/to/bundle` will be interpreted as `file:/a/path/to/bunde`.
# If the protocol is provided explicitly, then the value will be used as is.
#
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
// secure-connect-bundle = /location/of/secure/connect/bundle
}
# DataStax Insights monitoring.
basic.application {
# The name of the application using the session.
#
# It will be sent in the STARTUP protocol message for each new connection established by the
# driver.
#
# This can also be defined programmatically with DseSessionBuilder.withApplicationName(). If you
# specify both, the programmatic value takes precedence and this option is ignored.
#
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
// name =
# The version of the application using the session.
#
# It will be sent in the STARTUP protocol message for each new connection established by the
# driver.
#
# This can also be defined programmatically with DseSessionBuilder.withApplicationVersion(). If
# you specify both, the programmatic value takes precedence and this option is ignored.
#
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
// version =
}
# Graph (DataStax Enterprise only)
basic.graph {
# The name of the graph targeted by graph statements.
#
# This can also be overridden programmatically with GraphStatement.setGraphName(). If both are
# specified, the programmatic value takes precedence, and this option is ignored.
#
# Required: no. In particular, system queries -- such as creating or dropping a graph -- must be
# executed without a graph name (see also basic.graph.is-system-query).
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
// name = your-graph-name
# The traversal source to use for graph statements.
#
# This setting doesn't usually need to change, unless executing OLAP queries, which require the
# traversal source "a".
#
# This can also be overridden programmatically with GraphStatement.setTraversalSource(). If both
# are specified, the programmatic value takes precedence, and this option is ignored.
#
# Required: no
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
traversal-source = "g"
# Whether a script statement represents a system query.
#
# Script statements that access the `system` variable *must not* specify a graph name (otherwise
# `system` is not available). However, if your application executes a lot of non-system
# statements, it is convenient to configure basic.graph.name to avoid repeating it every time.
# This option allows you to ignore that global graph name, for example in a specific profile.
#
# This can also be overridden programmatically with ScriptGraphStatement.setSystemQuery(). If
# both are specified, the programmatic value takes precedence, and this option is ignored.
#
# Required: no (defaults to false)
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
// is-system-query = false
# The read consistency level to use for graph statements.
#
# DSE Graph is able to distinguish between read and write timeouts for the internal storage
# queries that will be produced by a traversal. Hence the consistency level for reads and writes
# can be set separately.
#
# This can also be overridden programmatically with GraphStatement.setReadConsistencyLevel(). If
# both are specified, the programmatic value takes precedence, and this option is ignored.
#
# Required: no (defaults to request.basic.consistency)
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
// read-consistency-level = LOCAL_QUORUM
# The write consistency level to use for graph statements.
#
# DSE Graph is able to distinguish between read and write timeouts for the internal storage
# queries that will be produced by a traversal. Hence the consistency level for reads and writes
# can be set separately.
#
# This can also be overridden programmatically with GraphStatement.setReadConsistencyLevel(). If
# both are specified, the programmatic value takes precedence, and this option is ignored.
#
# Required: no (defaults to request.basic.consistency)
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
// write-consistency-level = LOCAL_ONE
# How long the driver waits for a graph request to complete. This is a global limit on the
# duration of a session.execute() call, including any internal retries the driver might do.
#
# Graph statements behave a bit differently than regular CQL requests (hence this dedicated
# option instead of reusing basic.request.timeout): by default, the client timeout is not set,
# and the driver will just wait as long as needed until the server replies (which is itself
# governed by server-side timeout configuration).
# If you specify a client timeout with this option, then the driver will fail the request after
# the given time; note that the value is also sent along with the request, so that the server
# can also time out early and avoid wasting resources on a response that the client has already
# given up on.
#
# This can also be overridden programmatically with GraphStatement.setTimeout(). If both are
# specified, the programmatic value takes precedence, and this option is ignored.
#
# If this value is left unset (default) or is explicitly set to zero, no timeout will be
# applied.
#
# Required: no (defaults to zero - no timeout)
# Modifiable at runtime: yes, the new value will be used for requests issued after the change.
# Overridable in a profile: yes
// timeout = 10 seconds
}
# ADVANCED OPTIONS -------------------------------------------------------------------------------
# The maximum number of live sessions that are allowed to coexist in a given VM.
#
# This is intended to help detect resource leaks in client applications that create too many
# sessions and/or do not close them correctly. The driver keeps track of the number of live
# sessions in a static variable; if it gets over this threshold, a warning will be logged for
# every new session.
#
# If the value is less than or equal to 0, the feature is disabled: no warning will be issued.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for sessions created after the change.
# Overridable in a profile: no
advanced.session-leak.threshold = 4
advanced.connection {
# The timeout to use when establishing driver connections.
#
# This timeout is for controlling how long the driver will wait for the underlying channel
# to actually connect to the server. This is not the time limit for completing protocol
# negotiations, only the time limit for establishing a channel connection.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for connections created after the
# change.
# Overridable in a profile: no
connect-timeout = 5 seconds
# The timeout to use for internal queries that run as part of the initialization process, just
# after we open a connection. If this timeout fires, the initialization of the connection will
# fail. If this is the first connection ever, the driver will fail to initialize as well,
# otherwise it will retry the connection later.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for connections created after the
# change.
# Overridable in a profile: no
init-query-timeout = 5 seconds
# The timeout to use when the driver changes the keyspace on a connection at runtime (this
# happens when the client issues a `USE ...` query, and all connections belonging to the current
# session need to be updated).
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for connections created after the
# change.
# Overridable in a profile: no
set-keyspace-timeout = ${datastax-java-driver.advanced.connection.init-query-timeout}
# The driver maintains a connection pool to each node, according to the distance assigned to it
# by the load balancing policy.
# If the distance is LOCAL, then local.size connections are opened; if the distance is REMOTE,
# then remote.size connections are opened. If the distance is IGNORED, no connections at all
# are maintained.
pool {
# The number of connections in the pool for a node whose distance is LOCAL, that is, a node
# that belongs to the local datacenter, as inferred by the load balancing or defined by the
# option: datastax-java-driver.basic.load-balancing-policy.local-datacenter.
#
# Each connection can handle many concurrent requests, so 1 is generally a good place to
# start. You should only need higher values in very high performance scenarios, where
# connections might start maxing out their I/O thread (see the driver's online manual for
# more tuning instructions).
#
# Required: yes
# Modifiable at runtime: yes; when the change is detected, all active pools will be notified
# and will adjust their size.
# Overridable in a profile: no
local.size = 1
# The number of connections in the pool for a node whose distance is REMOTE, that is, a node
# that does not belong to the local datacenter.
#
# Note: by default, the built-in load-balancing policies will never assign the REMOTE distance
# to any node, to avoid cross-datacenter network traffic. If you want to change this behavior
# and understand the consequences, configure your policy to accept nodes in remote
# datacenters by adjusting the following advanced options:
#
# - datastax-java-driver.advanced.load-balancing-policy.dc-failover.max-nodes-per-remote-dc
# - datastax-java-driver.advanced.load-balancing-policy.dc-failover.allow-for-local-consistency-levels
#
# Required: yes
# Modifiable at runtime: yes; when the change is detected, all active pools will be notified
# and will adjust their size.
# Overridable in a profile: no
remote.size = 1
}
# The maximum number of requests that can be executed concurrently on a connection. This must be
# strictly positive, and less than 32768.
#
# We recommend against changing this value: the default of 1024 is fine for most situations,
# it's a good balance between sufficient concurrency on the client and reasonable pressure on
# the server. If you're looking for a way to limit the global throughput of the session, this is
# not the right way to do it: use a request throttler instead (see the `advanced.throttler`
# section in this configuration).
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for connections created after the
# change.
# Overridable in a profile: no
max-requests-per-connection = 1024
# The maximum number of "orphaned" requests before a connection gets closed automatically.
#
# Sometimes the driver writes to a node but stops listening for a response (for example if the
# request timed out, or was completed by another node). But we can't safely reuse the stream id
# on this connection until we know for sure that the server is done with it. Therefore the id is
# marked as "orphaned" until we get a response from the node.
#
# If the response never comes (or is lost because of a network issue), orphaned ids can
# accumulate over time, eventually affecting the connection's throughput. So we monitor them
# and close the connection above a given threshold (the pool will replace it).
#
# The value must be lower than `max-requests-per-connection`.
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for connections created after the
# change.
# Overridable in a profile: no
max-orphan-requests = 256
# Whether to log non-fatal errors when the driver tries to open a new connection.
#
# This error as recoverable, as the driver will try to reconnect according to the reconnection
# policy. Therefore some users see them as unnecessary clutter in the logs. On the other hand,
# those logs can be handy to debug a misbehaving node.
#
# Note that some type of errors are always logged, regardless of this option:
# - protocol version mismatches (the node gets forced down)
# - when the cluster name in system.local doesn't match the other nodes (the node gets forced
# down)
# - authentication errors (will be retried)
#
# Required: yes
# Modifiable at runtime: yes, the new value will be used for connections created after the
# change.
# Overridable in a profile: no
warn-on-init-error = true
}
# Advanced options for the built-in load-balancing policies.
advanced.load-balancing-policy {
# Cross-datacenter failover configuration: configure the load-balancing policies to use nodes
# in remote datacenters.
dc-failover {
# The maximum number of nodes to contact in each remote datacenter.
#
# By default, this number is zero, to avoid cross-datacenter network traffic. When this
# number is greater than zero:
#
# - The load policies will assign the REMOTE distance to that many nodes in each remote
# datacenter.
# - The driver will then attempt to open connections to those nodes. The actual number of
# connections to open to each one of those nodes is configurable via the option:
# datastax-java-driver.advanced.connection.pool.remote.size.
# - The load-balancing policies will include those remote nodes (and only those) in query
# plans, effectively enabling cross-datacenter failover.
#
# Beware that enabling such failover can result in cross-datacenter network traffic spikes,
# if the local datacenter is down or experiencing high latencies!
#
# Required: yes
# Modifiable at runtime: no
# Overridable in a profile: yes
max-nodes-per-remote-dc = 0
# Whether cross-datacenter failover should be allowed for requests executed with local
# consistency levels (LOCAL_ONE, LOCAL_QUORUM and LOCAL_SERIAL).
#
# This is disabled by default. Enabling this feature may have unexpected results, since a
# local consistency level may have different semantics depending on the replication factor in
# use in each datacenter.
#
# Required: yes
# Modifiable at runtime: no
# Overridable in a profile: yes
allow-for-local-consistency-levels = false
# Ordered preference list of remote dc's (in order) optionally supplied for automatic failover. While building a query plan, the driver uses the DC's supplied in order together with max-nodes-per-remote-dc
# Users are not required to specify all DCs, when listing preferences via this config
# Required: no
# Modifiable at runtime: no
# Overridable in a profile: no
preferred-remote-dcs = [""]
}
}
# Whether to schedule reconnection attempts if all contact points are unreachable on the first
# initialization attempt.
#
# If this is true, the driver will retry according to the reconnection policy. The
# `SessionBuilder.build()` call -- or the future returned by `SessionBuilder.buildAsync()` --
# won't complete until a contact point has been reached.
#
# If this is false and no contact points are available, the driver will fail with an
# AllNodesFailedException.
#
# Required: yes
# Modifiable at runtime: no
# Overridable in a profile: no
advanced.reconnect-on-init = false
# The policy that controls how often the driver tries to re-establish connections to down nodes.
#
# Required: yes
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: no
advanced.reconnection-policy {
# The class of the policy. If it is not qualified, the driver assumes that it resides in the
# package com.datastax.oss.driver.internal.core.connection.
#
# The driver provides two implementations out of the box: ExponentialReconnectionPolicy and
# ConstantReconnectionPolicy.
#
# You can also specify a custom class that implements ReconnectionPolicy and has a public
# constructor with a DriverContext argument.
class = ExponentialReconnectionPolicy
# ExponentialReconnectionPolicy starts with the base delay, and doubles it after each failed
# reconnection attempt, up to the maximum delay (after that it stays constant).
#
# ConstantReconnectionPolicy only uses the base-delay value, the interval never changes.
base-delay = 1 second
max-delay = 60 seconds
}
# The policy that controls if the driver retries requests that have failed on one node.
#
# Required: yes
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: yes. 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.
advanced.retry-policy {
# The class of the policy. If it is not qualified, the driver assumes that it resides in the
# package com.datastax.oss.driver.internal.core.retry.
#
# The driver provides two implementations out of the box:
#
# - DefaultRetryPolicy: the default policy, should almost always be the right choice.
# - ConsistencyDowngradingRetryPolicy: an alternative policy that weakens consistency guarantees
# as a trade-off to maximize the chance of success when retrying. Use with caution.
#
# Refer to the manual to understand how these policies work.
#
# You can also specify a custom class that implements RetryPolicy and has a public constructor
# with two arguments: the DriverContext and a String representing the profile name.
class = DefaultRetryPolicy
}
# The policy that controls if the driver pre-emptively tries other nodes if a node takes too long
# to respond.
#
# Required: yes
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: yes. 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.
advanced.speculative-execution-policy {
# The class of the policy. If it is not qualified, the driver assumes that it resides in the
# package com.datastax.oss.driver.internal.core.specex.
#
# The following implementations are available out of the box:
# - NoSpeculativeExecutionPolicy: never schedule any speculative execution
# - ConstantSpeculativeExecutionPolicy: schedule executions based on constant delays. This
# requires the `max-executions` and `delay` options below.
#
# You can also specify a custom class that implements SpeculativeExecutionPolicy and has a
# public constructor with two arguments: the DriverContext and a String representing the
# profile name.
class = NoSpeculativeExecutionPolicy
# The maximum number of executions (including the initial, non-speculative execution).
# This must be at least one.
// max-executions = 3
# The delay between each execution. 0 is allowed, and will result in all executions being sent
# simultaneously when the request starts.
#
# Note that sub-millisecond precision is not supported, any excess precision information will be
# dropped; in particular, delays of less than 1 millisecond are equivalent to 0.
#
# Also note that, because speculative executions are scheduled on the driver's timer thread,
# the duration specified here must be greater than the timer tick duration defined by the
# advanced.netty.timer.tick-duration setting (see below). If that is not the case, speculative
# executions will not be triggered as timely as desired.
#
# This must be positive or 0.
// delay = 100 milliseconds
}
# The component that handles authentication on each new connection.
#
# Required: no. If the 'class' child option is absent, no authentication will occur.
# Modifiable at runtime: no
# Overridable in a profile: no
#
# Note that the contents of this section can be overridden programmatically with
# SessionBuilder.withAuthProvider or SessionBuilder.withAuthCredentials.
advanced.auth-provider {
# The class of the provider. If it is not qualified, the driver assumes that it resides in one
# of the following packages:
# - com.datastax.oss.driver.internal.core.auth
# - com.datastax.dse.driver.internal.core.auth
#
# The driver provides two implementations:
# - PlainTextAuthProvider: uses plain-text credentials. It requires the `username` and
# `password` options below. When connecting to DataStax Enterprise, an optional
# `authorization-id` can also be specified.
# For backward compatibility with previous driver versions, you can also use the class name
# "DsePlainTextAuthProvider" for this provider.
# - DseGssApiAuthProvider: provides GSSAPI authentication for DSE clusters secured with
# DseAuthenticator. See the example below and refer to the manual for detailed instructions.
#
# You can also specify a custom class that implements AuthProvider and has a public constructor
# with a DriverContext argument (to simplify this, the driver provides two abstract classes that
# can be extended: PlainTextAuthProviderBase and DseGssApiAuthProviderBase).
#
# Finally, you can configure a provider instance programmatically with
# DseSessionBuilder#withAuthProvider. In that case, it will take precedence over the
# configuration.
// class = PlainTextAuthProvider
#
# Sample configuration for plain-text authentication providers:
// username = cassandra
// password = cassandra
#
# Proxy authentication: allows to login as another user or role (valid for both
# PlainTextAuthProvider and DseGssApiAuthProvider):
// authorization-id = userOrRole
#
# The settings below are only applicable to DseGssApiAuthProvider:
#
# Service name. For example, if in your dse.yaml configuration file the
# "kerberos_options/service_principal" setting is "cassandra/my.host.com@MY.REALM.COM", then set
# this option to "cassandra". If this value is not explicitly set via configuration (in an
# application.conf or programmatically), the driver will attempt to set it via a System
# property. The property should be "dse.sasl.service". For backwards compatibility with 1.x
# versions of the driver, if "dse.sasl.service" is not set as a System property, the driver will
# attempt to use "dse.sasl.protocol" as a fallback (which is the property for the 1.x driver).
//service = "cassandra"
#
# Login configuration. It is also possible to provide login configuration through a standard
# JAAS configuration file. The below configuration is just an example, see all possible options
# here:
# https://docs.oracle.com/javase/6/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/Krb5LoginModule.html
// login-configuration {
// principal = "cassandra@DATASTAX.COM"
// useKeyTab = "true"
// refreshKrb5Config = "true"
// keyTab = "/path/to/keytab/file"
// }
#
# Internal SASL properties, if any, such as QOP.
// sasl-properties {
// javax.security.sasl.qop = "auth-conf"
// }
}
# The SSL engine factory that will initialize an SSL engine for each new connection to a server.
#
# Required: no. If the 'class' child option is absent, SSL won't be activated.
# Modifiable at runtime: no
# Overridable in a profile: no
#
# Note that the contents of this section can be overridden programmatically with
# SessionBuilder.withSslEngineFactory or SessionBuilder#withSslContext.
advanced.ssl-engine-factory {
# The class of the factory. If it is not qualified, the driver assumes that it resides in the
# package com.datastax.oss.driver.internal.core.ssl.
#
# The driver provides a single implementation out of the box: DefaultSslEngineFactory, that uses
# the JDK's built-in SSL implementation.
#
# You can also specify a custom class that implements SslEngineFactory and has a public
# constructor with a DriverContext argument.
// class = DefaultSslEngineFactory
# Sample configuration for the default SSL factory:
# The cipher suites to enable when creating an SSLEngine for a connection.
# This property is optional. If it is not present, the driver won't explicitly enable cipher
# suites on the engine, which according to the JDK documentations results in "a minimum quality
# of service".
// cipher-suites = [ "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA" ]
# Whether or not to require validation that the hostname of the server certificate's common
# name matches the hostname of the server being connected to. If not set, defaults to true.
// hostname-validation = true
# The locations and passwords used to access truststore and keystore contents.
# These properties are optional. If either truststore-path or keystore-path are specified,
# the driver builds an SSLContext from these files. If neither option is specified, the
# default SSLContext is used, which is based on system property configuration.
// truststore-path = /path/to/client.truststore
// truststore-password = password123
// keystore-path = /path/to/client.keystore
// keystore-password = password123
# The duration between attempts to reload the keystore from the contents of the file specified
# by `keystore-path`. This is mainly relevant in environments where certificates have short
# lifetimes and applications are restarted infrequently, since an expired client certificate
# will prevent new connections from being established until the application is restarted. If
# not set, defaults to not reload the keystore.
// keystore-reload-interval = 30 minutes
}
# The generator that assigns a microsecond timestamp to each request.
#
# Required: yes
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: yes. 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 generator instance at runtime.
advanced.timestamp-generator {
# The class of the generator. If it is not qualified, the driver assumes that it resides in the
# package com.datastax.oss.driver.internal.core.time.
#
# The driver provides the following implementations out of the box:
# - AtomicTimestampGenerator: timestamps are guaranteed to be unique across all client threads.
# - ThreadLocalTimestampGenerator: timestamps that are guaranteed to be unique within each
# thread only.
# - ServerSideTimestampGenerator: do not generate timestamps, let the server assign them.
#
# You can also specify a custom class that implements TimestampGenerator and has a public
# constructor with two arguments: the DriverContext and a String representing the profile name.
class = AtomicTimestampGenerator
# To guarantee that queries are applied on the server in the same order as the client issued
# them, timestamps must be strictly increasing. But this means that, if the driver sends more
# than one query per microsecond, timestamps will drift in the future. While this could happen
# occasionally under high load, it should not be a regular occurrence. Therefore the built-in
# implementations log a warning to detect potential issues.
drift-warning {
# How far in the future timestamps are allowed to drift before the warning is logged.
# If it is undefined or set to 0, warnings are disabled.
threshold = 1 second
# How often the warning will be logged if timestamps keep drifting above the threshold.
interval = 10 seconds
}
# Whether to force the driver to use Java's millisecond-precision system clock.
# If this is false, the driver will try to access the microsecond-precision OS clock via native
# calls (and fallback to the Java one if the native calls fail).
# Unless you explicitly want to avoid native calls, there's no reason to change this.
force-java-clock = false
}
# Request trackers are session-wide components that get notified of the outcome of requests.
advanced.request-tracker {
# The list of trackers to register.
#
# This must be a list of class names, either fully-qualified or non-qualified; if the latter,
# the driver assumes that the class resides in the package
# com.datastax.oss.driver.internal.core.tracker.
#
# All classes specified here must implement
# com.datastax.oss.driver.api.core.tracker.RequestTracker and have a public constructor with a
# DriverContext argument.
#
# The driver provides the following implementation out of the box:
# - RequestLogger: logs requests (see the parameters below).
#
# You can also pass instances of your trackers programmatically with
# CqlSession.builder().addRequestTracker().
#
# Required: no
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: no
#classes = [RequestLogger,com.example.app.MyTracker]
# Parameters for RequestLogger. All of them can be overridden in a profile, and changed at
# runtime (the new values will be taken into account for requests logged after the change).
logs {
# Whether to log successful requests.
// success.enabled = true
slow {
# The threshold to classify a successful request as "slow". If this is unset, all successful
# requests will be considered as normal.
// threshold = 1 second
# Whether to log slow requests.
// enabled = true
}
# Whether to log failed requests.
// error.enabled = true
# The maximum length of the query string in the log message. If it is longer than that, it
# will be truncated.
// max-query-length = 500
# Whether to log bound values in addition to the query string.
// show-values = true
# The maximum length for bound values in the log message. If the formatted representation of a
# value is longer than that, it will be truncated.
// max-value-length = 50
# The maximum number of bound values to log. If a request has more values, the list of values
# will be truncated.
// max-values = 50
# Whether to log stack traces for failed queries. If this is disabled, the log will just
# include the exception's string representation (generally the class name and message).
// show-stack-traces = true
}
}
# A session-wide component that controls the rate at which requests are executed.
#
# Implementations vary, but throttlers generally track a metric that represents the level of
# utilization of the session, and prevent new requests from starting when that metric exceeds a
# threshold. Pending requests may be enqueued and retried later.
#
# From the public API's point of view, this process is mostly transparent: any time that the
# request is throttled is included in the session.execute() or session.executeAsync() call.
# Similarly, the request timeout encompasses throttling: the timeout starts ticking before the
# throttler has started processing the request; a request may time out while it is still in the
# throttler's queue, before the driver has even tried to send it to a node.
#
# The only visible effect is that a request may fail with a RequestThrottlingException, if the
# throttler has determined that it can neither allow the request to proceed now, nor enqueue it;
# this indicates that your session is overloaded.
#
# Required: yes
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: no
advanced.throttler {
# The class of the throttler. If it is not qualified, the driver assumes that it resides in
# the package com.datastax.oss.driver.internal.core.session.throttling.
#
# The driver provides the following implementations out of the box:
#
# - PassThroughRequestThrottler: does not perform any kind of throttling, all requests are
# allowed to proceed immediately. Required options: none.
#
# - ConcurrencyLimitingRequestThrottler: limits the number of requests that can be executed in
# parallel. Required options: max-concurrent-requests, max-queue-size.
#
# - RateLimitingRequestThrottler: limits the request rate per second. Required options:
# max-requests-per-second, max-queue-size, drain-interval.
#
# You can also specify a custom class that implements RequestThrottler and has a public
# constructor with a DriverContext argument.
class = PassThroughRequestThrottler
# The maximum number of requests that can be enqueued when the throttling threshold is exceeded.
# Beyond that size, requests will fail with a RequestThrottlingException.
// max-queue-size = 10000
# The maximum number of requests that are allowed to execute in parallel.
# Only used by ConcurrencyLimitingRequestThrottler.
// max-concurrent-requests = 10000
# The maximum allowed request rate.
# Only used by RateLimitingRequestThrottler.
// max-requests-per-second = 10000
# How often the throttler attempts to dequeue requests. This is the only way for rate-based
# throttling, because the completion of an active request does not necessarily free a "slot" for
# a queued one (the rate might still be too high).
#
# You want to set this high enough that each attempt will process multiple entries in the queue,
# but not delay requests too much. A few milliseconds is probably a happy medium.
#
# Only used by RateLimitingRequestThrottler.
// drain-interval = 10 milliseconds
}
# The list of node state listeners to register. Node state listeners are session-wide
# components that listen for node state changes (e.g., when nodes go down or back up).
#
# This must be a list of fully-qualified class names; classes specified here must implement
# com.datastax.oss.driver.api.core.metadata.NodeStateListener and have a public
# constructor with a DriverContext argument.
#
# You can also pass instances of your listeners programmatically with
# CqlSession.builder().addNodeStateListener().
#
# Required: no
# Modifiable at runtime: no (but custom implementations may elect to watch configuration changes
# and allow child options to be changed at runtime).
# Overridable in a profile: no
#advanced.node-state-listener.classes = [com.example.app.MyListener1,com.example.app.MyListener2]
# The list of schema change listeners to register. Schema change listeners are session-wide
# components that listen for schema changes (e.g., when tables are created or dropped).
#
# This must be a list of fully-qualified class names; classes specified here must implement
# com.datastax.oss.driver.api.core.metadata.schema.SchemaChangeListener and have a public
# constructor with a DriverContext argument.
#
# You can also pass instances of your listeners programmatically with