public class Configuration extends Object
This is also where you get the configured policies, though those cannot be changed (they are set during the built of the Cluster object).
| Modifier and Type | Class and Description |
|---|---|
static class |
Configuration.Builder
A builder to create a new
Configuration object. |
| Modifier | Constructor and Description |
|---|---|
protected |
Configuration(Configuration toCopy)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Configuration.Builder |
builder()
Returns a builder to create a new
Configuration object. |
ApplicationInfo |
getApplicationInfo() |
CodecRegistry |
getCodecRegistry()
Returns the
CodecRegistry instance for this configuration. |
String |
getDefaultKeyspace() |
MetricsOptions |
getMetricsOptions()
Returns the metrics configuration, if metrics are enabled.
|
NettyOptions |
getNettyOptions()
Returns the
NettyOptions instance for this configuration. |
Policies |
getPolicies()
Returns the policies set for the cluster.
|
PoolingOptions |
getPoolingOptions()
Returns the connection pooling configuration.
|
ProtocolOptions |
getProtocolOptions()
Returns the Cassandra binary protocol level configuration (compression).
|
QueryOptions |
getQueryOptions()
Returns the queries configuration.
|
SocketOptions |
getSocketOptions()
Returns the low-level TCP configuration options used (tcpNoDelay, keepAlive, ...).
|
ThreadingOptions |
getThreadingOptions() |
boolean |
isDriverConfigReportingEnabled()
Whether driver configuration reporting is enabled, i.e. whether the control connection sends a
DRIVER_CONFIG JSON blob describing the effective driver configuration in its startup
options. |
protected Configuration(Configuration toCopy)
toCopy - the object to copy from.public static Configuration.Builder builder()
Configuration object.
You only need this if you are building the configuration yourself. If you use Cluster.builder(), it will be done under the hood for you.
public Policies getPolicies()
public SocketOptions getSocketOptions()
public ProtocolOptions getProtocolOptions()
public PoolingOptions getPoolingOptions()
public MetricsOptions getMetricsOptions()
Metrics collection is enabled by default but can be disabled at cluster construction time
through Cluster.Builder.withoutMetrics().
null if metrics are not enabled.public QueryOptions getQueryOptions()
public ThreadingOptions getThreadingOptions()
public NettyOptions getNettyOptions()
NettyOptions instance for this configuration.NettyOptions instance for this configuration.public String getDefaultKeyspace()
public ApplicationInfo getApplicationInfo()
@Beta public boolean isDriverConfigReportingEnabled()
DRIVER_CONFIG JSON blob describing the effective driver configuration in its startup
options. Enabled by default.
This does not govern the SESSION_ID startup option, which every connection always
sends regardless of this setting.
true if driver configuration reporting is enabled.public CodecRegistry getCodecRegistry()
CodecRegistry instance for this configuration.
Note that this method could return CodecRegistry.DEFAULT_INSTANCE if no specific
codec registry has been set on the Cluster. In this case, care should be taken when
registering new codecs as they would be immediately available to other Cluster
instances sharing the same default instance.
CodecRegistry instance for this configuration.Copyright © 2012–2026. All rights reserved.