@Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("host", this.host) .add("keyspace", config.getKeyspaceOrThrow()) .add("usingSsl", config.usingSsl()) .add("sslConfiguration", config.sslConfiguration().isPresent() ? config.sslConfiguration().get() : "unspecified") .add("socketTimeoutMillis", config.socketTimeoutMillis()) .add("socketQueryTimeoutMillis", config.socketQueryTimeoutMillis()) .toString(); }
@Before public void setup() { config = mock(CassandraKeyValueServiceConfig.class); when(config.poolRefreshIntervalSeconds()).thenReturn(POOL_REFRESH_INTERVAL_SECONDS); when(config.timeBetweenConnectionEvictionRunsSeconds()).thenReturn(TIME_BETWEEN_EVICTION_RUNS_SECONDS); when(config.unresponsiveHostBackoffTimeSeconds()).thenReturn(UNRESPONSIVE_HOST_BACKOFF_SECONDS); blacklist = new Blacklist(config); doAnswer(invocation -> poolServers.add(getInvocationAddress(invocation))).when(cassandra).addPool(any()); doAnswer(invocation -> poolServers.remove(getInvocationAddress(invocation))).when(cassandra).removePool(any()); doAnswer(invocation -> poolServers.stream().collect( Collectors.toMap(x -> x, x -> mock(CassandraClientPoolingContainer.class)))).when(cassandra).getPools(); when(config.socketTimeoutMillis()).thenReturn(1); }
private static Cassandra.Client getRawClient(InetSocketAddress addr, CassandraKeyValueServiceConfig config) throws TException { TSocket thriftSocket = new TSocket(addr.getHostString(), addr.getPort(), config.socketTimeoutMillis()); thriftSocket.open(); try {
poolConfig.setMaxWaitMillis(config.socketTimeoutMillis());
@Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("host", this.host) .add("keyspace", config.getKeyspaceOrThrow()) .add("usingSsl", config.usingSsl()) .add("sslConfiguration", config.sslConfiguration().isPresent() ? config.sslConfiguration().get() : "unspecified") .add("socketTimeoutMillis", config.socketTimeoutMillis()) .add("socketQueryTimeoutMillis", config.socketQueryTimeoutMillis()) .toString(); }
private static Cassandra.Client getRawClient(InetSocketAddress addr, CassandraKeyValueServiceConfig config) throws TException { TSocket thriftSocket = new TSocket(addr.getHostString(), addr.getPort(), config.socketTimeoutMillis()); thriftSocket.open(); try {
poolConfig.setMaxWaitMillis(config.socketTimeoutMillis());