/** * This is the maximum number of times we'll accept connection failures to one host before blacklisting it. Note * that subsequent hosts we try in the same call will actually be blacklisted after one connection failure */ @VisibleForTesting static int getMaxRetriesPerHost() { return CassandraKeyValueServiceRuntimeConfig.getDefault().numberOfRetriesOnSameHost(); }
public static CassandraClientPool create(MetricsManager metricsManager, CassandraKeyValueServiceConfig config, Supplier<CassandraKeyValueServiceRuntimeConfig> runtimeConfig, boolean initializeAsync) { Blacklist blacklist = new Blacklist(config); CassandraRequestExceptionHandler exceptionHandler = new CassandraRequestExceptionHandler( () -> runtimeConfig.get().numberOfRetriesOnSameHost(), () -> runtimeConfig.get().numberOfRetriesOnAllHosts(), () -> runtimeConfig.get().conservativeRequestExceptionHandler(), blacklist); CassandraClientPoolImpl cassandraClientPool = new CassandraClientPoolImpl( metricsManager, config, StartupChecks.RUN, exceptionHandler, blacklist); cassandraClientPool.wrapper.initialize(initializeAsync); return cassandraClientPool.wrapper.isInitialized() ? cassandraClientPool : cassandraClientPool.wrapper; }
/** * This is the maximum number of times we'll accept connection failures to one host before blacklisting it. Note * that subsequent hosts we try in the same call will actually be blacklisted after one connection failure */ @VisibleForTesting static int getMaxRetriesPerHost() { return CassandraKeyValueServiceRuntimeConfig.getDefault().numberOfRetriesOnSameHost(); }
public static CassandraClientPool create(MetricsManager metricsManager, CassandraKeyValueServiceConfig config, Supplier<CassandraKeyValueServiceRuntimeConfig> runtimeConfig, boolean initializeAsync) { Blacklist blacklist = new Blacklist(config); CassandraRequestExceptionHandler exceptionHandler = new CassandraRequestExceptionHandler( () -> runtimeConfig.get().numberOfRetriesOnSameHost(), () -> runtimeConfig.get().numberOfRetriesOnAllHosts(), () -> runtimeConfig.get().conservativeRequestExceptionHandler(), blacklist); CassandraClientPoolImpl cassandraClientPool = new CassandraClientPoolImpl( metricsManager, config, StartupChecks.RUN, exceptionHandler, blacklist); cassandraClientPool.wrapper.initialize(initializeAsync); return cassandraClientPool.wrapper.isInitialized() ? cassandraClientPool : cassandraClientPool.wrapper; }