Search in sources :

Example 1 with AsyncKeyValueService

use of com.palantir.atlasdb.keyvalue.api.AsyncKeyValueService in project atlasdb by palantir.

the class CassandraKeyValueServiceImpl method createWithCqlClient.

private static CassandraKeyValueService createWithCqlClient(MetricsManager metricsManager, CassandraKeyValueServiceConfig config, Refreshable<CassandraKeyValueServiceRuntimeConfig> runtimeConfig, CassandraClientPool clientPool, CassandraMutationTimestampProvider mutationTimestampProvider, Logger log, boolean initializeAsync) {
    try {
        CassandraClusterConfig clusterConfig = CassandraClusterConfig.of(config, runtimeConfig.get());
        AsyncKeyValueService asyncKeyValueService = config.asyncKeyValueServiceFactory().constructAsyncKeyValueService(metricsManager, config.getKeyspaceOrThrow(), clusterConfig, runtimeConfig.map(CassandraKeyValueServiceRuntimeConfig::servers), initializeAsync);
        return createAndInitialize(metricsManager, config, runtimeConfig, clientPool, asyncKeyValueService, mutationTimestampProvider, log, initializeAsync);
    } catch (Exception e) {
        log.warn("Exception during async KVS creation.", e);
        throw Throwables.unwrapAndThrowAtlasDbDependencyException(e);
    }
}
Also used : CassandraClusterConfig(com.palantir.atlasdb.keyvalue.cassandra.async.client.creation.ClusterFactory.CassandraClusterConfig) AsyncKeyValueService(com.palantir.atlasdb.keyvalue.api.AsyncKeyValueService) AtlasDbDependencyException(com.palantir.common.exception.AtlasDbDependencyException) InsufficientConsistencyException(com.palantir.atlasdb.keyvalue.api.InsufficientConsistencyException) CheckAndSetException(com.palantir.atlasdb.keyvalue.api.CheckAndSetException) KeyAlreadyExistsException(com.palantir.atlasdb.keyvalue.api.KeyAlreadyExistsException) FunctionCheckedException(com.palantir.common.base.FunctionCheckedException) RetryLimitReachedException(com.palantir.atlasdb.keyvalue.api.RetryLimitReachedException) TException(org.apache.thrift.TException) UncheckedExecutionException(com.google.common.util.concurrent.UncheckedExecutionException) PalantirRuntimeException(com.palantir.common.exception.PalantirRuntimeException)

Aggregations

UncheckedExecutionException (com.google.common.util.concurrent.UncheckedExecutionException)1 AsyncKeyValueService (com.palantir.atlasdb.keyvalue.api.AsyncKeyValueService)1 CheckAndSetException (com.palantir.atlasdb.keyvalue.api.CheckAndSetException)1 InsufficientConsistencyException (com.palantir.atlasdb.keyvalue.api.InsufficientConsistencyException)1 KeyAlreadyExistsException (com.palantir.atlasdb.keyvalue.api.KeyAlreadyExistsException)1 RetryLimitReachedException (com.palantir.atlasdb.keyvalue.api.RetryLimitReachedException)1 CassandraClusterConfig (com.palantir.atlasdb.keyvalue.cassandra.async.client.creation.ClusterFactory.CassandraClusterConfig)1 FunctionCheckedException (com.palantir.common.base.FunctionCheckedException)1 AtlasDbDependencyException (com.palantir.common.exception.AtlasDbDependencyException)1 PalantirRuntimeException (com.palantir.common.exception.PalantirRuntimeException)1 TException (org.apache.thrift.TException)1