Search in sources :

Example 11 with CassandraClientPoolingContainer

use of com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolingContainer in project atlasdb by palantir.

the class CassandraService method addPool.

public void addPool(CassandraServer server) {
    int currentPoolNumber = cassandraHosts.indexOf(server) + 1;
    addPoolInternal(server, new CassandraClientPoolingContainer(metricsManager, server, config, currentPoolNumber, poolMetrics));
}
Also used : CassandraClientPoolingContainer(com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolingContainer)

Example 12 with CassandraClientPoolingContainer

use of com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolingContainer in project atlasdb by palantir.

the class WeightedServersTest method createMockClientPoolingContainerWithUtilization.

private static CassandraClientPoolingContainer createMockClientPoolingContainerWithUtilization(int utilization) {
    CassandraClientPoolingContainer mock = Mockito.mock(CassandraClientPoolingContainer.class);
    Mockito.when(mock.getOpenRequests()).thenReturn(utilization);
    return mock;
}
Also used : CassandraClientPoolingContainer(com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolingContainer)

Aggregations

CassandraClientPoolingContainer (com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPoolingContainer)12 ImmutableMap (com.google.common.collect.ImmutableMap)7 InetSocketAddress (java.net.InetSocketAddress)7 HashMap (java.util.HashMap)7 Map (java.util.Map)7 NavigableMap (java.util.NavigableMap)5 Test (org.junit.Test)5 FunctionCheckedException (com.palantir.common.base.FunctionCheckedException)3 SafeIllegalStateException (com.palantir.logsafe.exceptions.SafeIllegalStateException)3 UnknownHostException (java.net.UnknownHostException)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 Suppliers (com.google.common.base.Suppliers)2 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableRangeMap (com.google.common.collect.ImmutableRangeMap)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 Interner (com.google.common.collect.Interner)2 Interners (com.google.common.collect.Interners)2 Iterables (com.google.common.collect.Iterables)2 Range (com.google.common.collect.Range)2 RangeMap (com.google.common.collect.RangeMap)2