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 Detail

      • servers

        @Deprecated
        Optional<CassandraServersConfigs.CassandraServersConfig> servers()
        Deprecated.
        Use CassandraKeyValueServiceRuntimeConfig.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.
      • namespace

        @Derived
        default Optional<String> namespace()
        Specified by:
        namespace in interface com.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 the poolSize() given high request load. When load is depressed, the pool will shrink back to its idle poolSize() value.
      • proportionConnectionsToCheckPerEvictionRun

        @Default
        default double proportionConnectionsToCheckPerEvictionRun()
        The proportion of poolSize() connections that are checked approximately every timeBetweenConnectionEvictionRunsSeconds() seconds to see if has been idle at least idleConnectionTimeoutSeconds() 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.
      • 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.
      • ssl

        @Deprecated
        Optional<Boolean> ssl()
        Deprecated.
        Use sslConfiguration() 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 new AsyncKeyValueService 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.
      • 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 a SocketTimeoutException 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 the socketQueryTimeoutMillis(). 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 configuration
        Obsolete value, replaced by SweepConfig#readLimit.
      • type

        default String type()
        Specified by:
        type in interface com.palantir.atlasdb.spi.KeyValueServiceConfig
      • 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 interface com.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.