Package com.palantir.atlasdb.cassandra
Interface CassandraKeyValueServiceConfig
-
- All Superinterfaces:
com.palantir.atlasdb.spi.KeyValueServiceConfig
@DoNotLog @AutoService(com.palantir.atlasdb.spi.KeyValueServiceConfig.class) @Immutable public interface CassandraKeyValueServiceConfig extends com.palantir.atlasdb.spi.KeyValueServiceConfig
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Map<String,InetSocketAddress>
addressTranslation()
default CassandraAsyncKeyValueServiceFactory
asyncKeyValueServiceFactory()
An object which implements the logic behind CQL communication resource management.default boolean
autoRefreshNodes()
default void
check()
default boolean
clusterMeetsNormalConsistencyGuarantees()
default int
concurrentGetRangesThreadPoolSize()
CassandraReloadableKeyValueServiceRuntimeConfig
uses the value below if and only if it is greater than 0, otherwise deriving fomCassandraKeyValueServiceRuntimeConfig.servers()
in a similar fashion.default int
consecutiveAbsencesBeforePoolRemoval()
This sets the number of times a node needs to be detected as absent from the Cassandra ring before its client pool is removed.default int
cqlPoolTimeoutMillis()
CassandraCredentialsConfig
credentials()
default int
defaultGetRangesConcurrency()
default boolean
enableEndpointVerification()
Verify Cassandra hostname or ip address match any of the addresses listed in the servers certificate.default boolean
enableNamespaceDeletionDangerousIKnowWhatIAmDoing()
Optional<Integer>
fetchBatchCount()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.fetchBatchCount()
to make this value live-reloadable.default int
gcGraceSeconds()
The gc_grace_seconds for all tables(column families).default String
getKeyspaceOrThrow()
default int
idleConnectionTimeoutSeconds()
default boolean
ignoreDatacenterConfigurationChecks()
default boolean
ignoreInconsistentRingChecks()
default boolean
ignoreNodeTopologyChecks()
default boolean
ignorePartitionerChecks()
default int
initialSocketQueryTimeoutMillis()
When a Cassandra node is down or acting malignantly, it is plausible that we succeed in creating a socket but subsequently do not read anything, and thus are at the mercy of thesocketQueryTimeoutMillis()
.Optional<CassandraJmxCompactionConfig>
jmx()
Optional<String>
keyspace()
Deprecated.Use the AtlasDbConfig#namespace to specify it instead.default double
localHostWeighting()
This increases the likelihood of selecting an instance that is hosted in the same rack as the process.default int
maxConnectionBurstSize()
The cap at which the connection pool is able to grow over thepoolSize()
given high request load.Optional<Integer>
mutationBatchCount()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.mutationBatchCount()
to make this value live-reloadable.Optional<Integer>
mutationBatchSizeBytes()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.mutationBatchSizeBytes()
to make this value live-reloadable.default Optional<String>
namespace()
default int
numPoolRefreshingThreads()
Number of threads to be used across ALL transaction managers to refresh the client pool.Optional<HostLocation>
overrideHostLocation()
Overrides the behaviour of the host location supplier.default int
poolRefreshIntervalSeconds()
The period between refreshing the Cassandra client pools.default int
poolSize()
default double
proportionConnectionsToCheckPerEvictionRun()
The proportion ofpoolSize()
connections that are checked approximately everytimeBetweenConnectionEvictionRunsSeconds()
seconds to see if has been idle at leastidleConnectionTimeoutSeconds()
seconds and evicts it from the pool if so.default int
rangesConcurrency()
Optional<Integer>
replicationFactor()
Deprecated.default int
schemaMutationTimeoutMillis()
Optional<CassandraServersConfigs.CassandraServersConfig>
servers()
Deprecated.default int
socketQueryTimeoutMillis()
Socket timeout is a java side concept.default int
socketTimeoutMillis()
This is how long we will wait when we first open a socket to the cassandra server.Optional<Boolean>
ssl()
Deprecated.UsesslConfiguration()
instead.Optional<com.palantir.conjure.java.api.config.ssl.SslConfiguration>
sslConfiguration()
An object for specifying ssl configuration details.Optional<Integer>
sweepReadThreads()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.sweepReadThreads()
to make this value live-reloadable.Optional<Supplier<ExecutorService>>
thriftExecutorServiceFactory()
If provided, will be used to create executor service used to perform some blocking calls to Cassandra.default int
timeBetweenConnectionEvictionRunsSeconds()
default com.palantir.conjure.java.api.config.service.HumanReadableDuration
timeoutOnConnectionBorrow()
Times out after the provided duration when borrowing objects from the Cassandra client pool.default Duration
timeoutOnConnectionClose()
Times out after the provided duration when attempting to close evicted connections from the Cassandra threadpool.default Integer
timestampsGetterBatchSize()
Deprecated.this parameter is unused and should be removed from the configurationdefault String
type()
Optional<Integer>
unresponsiveHostBackoffTimeSeconds()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.unresponsiveHostBackoffTimeSeconds()
to make this value live-reloadable.default boolean
usingSsl()
-
-
-
Field Detail
-
TYPE
static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
servers
@Deprecated Optional<CassandraServersConfigs.CassandraServersConfig> servers()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.servers()
. These are only the initial 'contact points' that will be used in connecting with the cluster. AtlasDB will subsequently discover additional hosts in the cluster. (This is true for both Thrift and CQL endpoints.) This value, or values derived from it (e.g. the number of Thrift hosts) must ONLY be used on KVS initialization to generate the initial connection(s) to the cluster, or as part of startup checks.
-
addressTranslation
@Default default Map<String,InetSocketAddress> addressTranslation()
-
namespace
@Derived default Optional<String> namespace()
- Specified by:
namespace
in interfacecom.palantir.atlasdb.spi.KeyValueServiceConfig
-
poolSize
@Default default int poolSize()
-
maxConnectionBurstSize
@Default default int maxConnectionBurstSize()
The cap at which the connection pool is able to grow over thepoolSize()
given high request load. When load is depressed, the pool will shrink back to its idlepoolSize()
value.
-
proportionConnectionsToCheckPerEvictionRun
@Default default double proportionConnectionsToCheckPerEvictionRun()
The proportion ofpoolSize()
connections that are checked approximately everytimeBetweenConnectionEvictionRunsSeconds()
seconds to see if has been idle at leastidleConnectionTimeoutSeconds()
seconds and evicts it from the pool if so. For example, given the default values, 0.1 * 30 = 3 connections will be checked approximately every 20 seconds and will be evicted from the pool if it has been idle for at least 10 minutes.
-
idleConnectionTimeoutSeconds
@Default default int idleConnectionTimeoutSeconds()
-
timeBetweenConnectionEvictionRunsSeconds
@Default default int timeBetweenConnectionEvictionRunsSeconds()
-
poolRefreshIntervalSeconds
@Default default int poolRefreshIntervalSeconds()
The period between refreshing the Cassandra client pools. At every refresh, we check the health of the current blacklisted nodes — if they're healthy, we whitelist them.
-
unresponsiveHostBackoffTimeSeconds
@Deprecated Optional<Integer> unresponsiveHostBackoffTimeSeconds()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.unresponsiveHostBackoffTimeSeconds()
to make this value live-reloadable.The minimal period we wait to check if a Cassandra node is healthy after it has been blacklisted.
-
gcGraceSeconds
@Default default int gcGraceSeconds()
The gc_grace_seconds for all tables(column families). This is the maximum TTL for tombstones in Cassandra as data marked with a tombstone is removed during the normal compaction process every gc_grace_seconds.
-
localHostWeighting
@Default default double localHostWeighting()
This increases the likelihood of selecting an instance that is hosted in the same rack as the process. Weighting is a ratio from 0 to 1, where 0 disables the feature and 1 forces the same rack if possible.
-
consecutiveAbsencesBeforePoolRemoval
@Default default int consecutiveAbsencesBeforePoolRemoval()
This sets the number of times a node needs to be detected as absent from the Cassandra ring before its client pool is removed. Configuring this may be useful for nodes operating in environments where IPs change frequently.
-
overrideHostLocation
Optional<HostLocation> overrideHostLocation()
Overrides the behaviour of the host location supplier.
-
timeoutOnConnectionClose
@Default default Duration timeoutOnConnectionClose()
Times out after the provided duration when attempting to close evicted connections from the Cassandra threadpool. Note that this is potentially unsafe in the general case, as unclosed connections can eventually leak memory.
-
timeoutOnConnectionBorrow
@Default default com.palantir.conjure.java.api.config.service.HumanReadableDuration timeoutOnConnectionBorrow()
Times out after the provided duration when borrowing objects from the Cassandra client pool.
-
getKeyspaceOrThrow
@Lazy default String getKeyspaceOrThrow()
-
keyspace
@Deprecated Optional<String> keyspace()
Deprecated.Use the AtlasDbConfig#namespace to specify it instead.Note that when the keyspace is read, this field must be present.
-
credentials
CassandraCredentialsConfig credentials()
-
ssl
@Deprecated Optional<Boolean> ssl()
Deprecated.UsesslConfiguration()
instead.A boolean declaring whether or not to use ssl to communicate with cassandra. This configuration value is deprecated in favor of using sslConfiguration. If true, read in trust and key store information from system properties unless the sslConfiguration object is specified.
-
sslConfiguration
Optional<com.palantir.conjure.java.api.config.ssl.SslConfiguration> sslConfiguration()
An object for specifying ssl configuration details. The lack of existence of this object implies ssl is not to be used to connect to cassandra.The existence of this object overrides any configuration made via the ssl config value.
-
asyncKeyValueServiceFactory
@Default default CassandraAsyncKeyValueServiceFactory asyncKeyValueServiceFactory()
An object which implements the logic behind CQL communication resource management. Default factory object creates a newAsyncKeyValueService
with new session and thread pool every time. For smarter resource management this option should be programmatically set for client specific resource management.
-
thriftExecutorServiceFactory
Optional<Supplier<ExecutorService>> thriftExecutorServiceFactory()
If provided, will be used to create executor service used to perform some blocking calls to Cassandra. Otherwise, a new executor service will be created with default configuration.
-
replicationFactor
@Deprecated Optional<Integer> replicationFactor()
Deprecated.
-
mutationBatchCount
@Deprecated Optional<Integer> mutationBatchCount()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.mutationBatchCount()
to make this value live-reloadable.
-
mutationBatchSizeBytes
@Deprecated Optional<Integer> mutationBatchSizeBytes()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.mutationBatchSizeBytes()
to make this value live-reloadable.
-
fetchBatchCount
@Deprecated Optional<Integer> fetchBatchCount()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.fetchBatchCount()
to make this value live-reloadable.
-
ignoreNodeTopologyChecks
@Default default boolean ignoreNodeTopologyChecks()
-
ignoreInconsistentRingChecks
@Default default boolean ignoreInconsistentRingChecks()
-
ignoreDatacenterConfigurationChecks
@Default default boolean ignoreDatacenterConfigurationChecks()
-
ignorePartitionerChecks
@Default default boolean ignorePartitionerChecks()
-
autoRefreshNodes
@Default default boolean autoRefreshNodes()
-
clusterMeetsNormalConsistencyGuarantees
@Default default boolean clusterMeetsNormalConsistencyGuarantees()
-
socketTimeoutMillis
@Default default int socketTimeoutMillis()
This is how long we will wait when we first open a socket to the cassandra server. This should be long enough to enough to handle cross data center latency, but short enough that it will fail out quickly if it is clear we can't reach that server.
-
socketQueryTimeoutMillis
@Default default int socketQueryTimeoutMillis()
Socket timeout is a java side concept. This the maximum time we will block on a network read without the server sending us any bytes. After this time aSocketTimeoutException
will be thrown. All cassandra reads time out at less than this value so we shouldn't see it very much (10s by default).
-
initialSocketQueryTimeoutMillis
@Default default int initialSocketQueryTimeoutMillis()
When a Cassandra node is down or acting malignantly, it is plausible that we succeed in creating a socket but subsequently do not read anything, and thus are at the mercy of thesocketQueryTimeoutMillis()
. This is particularly problematic on the creation of transaction managers and client pools in general: we can end up in a state where a query to a bad host blocks us for up to 186 seconds with default settings (due to retrying three times on the first node). This initial timeout actually affects the creation of the clients themselves, and is only set for the call to login on Cassandra. When that is successful, the query timeout is set to the regular setting above.
-
cqlPoolTimeoutMillis
@Default default int cqlPoolTimeoutMillis()
-
schemaMutationTimeoutMillis
@Default default int schemaMutationTimeoutMillis()
-
rangesConcurrency
@Default default int rangesConcurrency()
-
timestampsGetterBatchSize
@Default @Deprecated default Integer timestampsGetterBatchSize()
Deprecated.this parameter is unused and should be removed from the configurationObsolete value, replaced bySweepConfig#readLimit
.
-
sweepReadThreads
@Deprecated Optional<Integer> sweepReadThreads()
Deprecated.UseCassandraKeyValueServiceRuntimeConfig.sweepReadThreads()
to make this value live-reloadable.
-
jmx
Optional<CassandraJmxCompactionConfig> jmx()
-
type
default String type()
- Specified by:
type
in interfacecom.palantir.atlasdb.spi.KeyValueServiceConfig
-
concurrentGetRangesThreadPoolSize
@Default default int concurrentGetRangesThreadPoolSize()
CassandraReloadableKeyValueServiceRuntimeConfig
uses the value below if and only if it is greater than 0, otherwise deriving fomCassandraKeyValueServiceRuntimeConfig.servers()
in a similar fashion. As a result, if the below derivation is changed to be non-zero whenservers()
is empty, then this will always take precedence over the derived value from the reloadable config. If such a change happens,CassandraReloadableKeyValueServiceRuntimeConfig.concurrentGetRangesThreadPoolSize()
should be updated to compare against a new sentinel value (e.g the calculated value when servers is empty) so that the reloadable config correctly flips over to using the runtime derived value when appropriate.
-
defaultGetRangesConcurrency
@Default default int defaultGetRangesConcurrency()
-
enableEndpointVerification
@Default default boolean enableEndpointVerification()
Verify Cassandra hostname or ip address match any of the addresses listed in the servers certificate. Currently, this is only used by Thrift.
-
usingSsl
@Derived default boolean usingSsl()
-
enableNamespaceDeletionDangerousIKnowWhatIAmDoing
@Default default boolean enableNamespaceDeletionDangerousIKnowWhatIAmDoing()
- Specified by:
enableNamespaceDeletionDangerousIKnowWhatIAmDoing
in interfacecom.palantir.atlasdb.spi.KeyValueServiceConfig
-
check
@Check default void check()
-
numPoolRefreshingThreads
@Default default int numPoolRefreshingThreads()
Number of threads to be used across ALL transaction managers to refresh the client pool. It is suggested to use one thread per approximately 10 transaction managers that are expected to be used.
-
-