Class CassandraClientPoolImpl
- java.lang.Object
-
- com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolImpl
-
- All Implemented Interfaces:
CassandraClientPool
public class CassandraClientPoolImpl extends Object implements CassandraClientPool
Feature breakdown: - Pooling - Token Aware Mapping / Query Routing / Data partitioning - Retriable Queries - Pool member error tracking / blacklisting* - Pool refreshing - Pool node autodiscovery - Pool member health checking**entirely new features
By our old system, this would be a RefreshingRetriableTokenAwareHealthCheckingManyHostCassandraClientPoolingContainerManager; ... this is one of the reasons why there is a new system.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CassandraClientPoolImpl.StartupChecks
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CassandraClientPool
create(com.palantir.atlasdb.util.MetricsManager metricsManager, CassandraKeyValueServiceConfig config, com.palantir.refreshable.Refreshable<CassandraKeyValueServiceRuntimeConfig> runtimeConfig, boolean initializeAsync)
Map<CassandraServer,CassandraClientPoolingContainer>
getCurrentPools()
CassandraServer
getRandomServerForKey(byte[] key)
com.palantir.common.base.FunctionCheckedException<CassandraClient,Void,Exception>
getValidatePartitioner()
<V,K extends Exception>
Vrun(com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn)
<V,K extends Exception>
VrunOnCassandraServer(CassandraServer specifiedServer, com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn)
<V,K extends Exception>
VrunWithRetry(com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn)
<V,K extends Exception>
VrunWithRetryOnServer(CassandraServer specifiedServer, com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn)
void
shutdown()
-
-
-
Method Detail
-
create
public static CassandraClientPool create(com.palantir.atlasdb.util.MetricsManager metricsManager, CassandraKeyValueServiceConfig config, com.palantir.refreshable.Refreshable<CassandraKeyValueServiceRuntimeConfig> runtimeConfig, boolean initializeAsync)
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceCassandraClientPool
-
getCurrentPools
public Map<CassandraServer,CassandraClientPoolingContainer> getCurrentPools()
- Specified by:
getCurrentPools
in interfaceCassandraClientPool
-
getRandomServerForKey
public CassandraServer getRandomServerForKey(byte[] key)
- Specified by:
getRandomServerForKey
in interfaceCassandraClientPool
-
runWithRetry
public <V,K extends Exception> V runWithRetry(com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn) throws K extends Exception
- Specified by:
runWithRetry
in interfaceCassandraClientPool
- Throws:
K extends Exception
-
runWithRetryOnServer
public <V,K extends Exception> V runWithRetryOnServer(CassandraServer specifiedServer, com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn) throws K extends Exception
- Specified by:
runWithRetryOnServer
in interfaceCassandraClientPool
- Throws:
K extends Exception
-
run
public <V,K extends Exception> V run(com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn) throws K extends Exception
- Specified by:
run
in interfaceCassandraClientPool
- Throws:
K extends Exception
-
runOnCassandraServer
public <V,K extends Exception> V runOnCassandraServer(CassandraServer specifiedServer, com.palantir.common.base.FunctionCheckedException<CassandraClient,V,K> fn) throws K extends Exception
- Specified by:
runOnCassandraServer
in interfaceCassandraClientPool
- Throws:
K extends Exception
-
getValidatePartitioner
public com.palantir.common.base.FunctionCheckedException<CassandraClient,Void,Exception> getValidatePartitioner()
- Specified by:
getValidatePartitioner
in interfaceCassandraClientPool
-
-