private void tryInitialize() { cassandra.cacheInitialCassandraHosts(); refreshPoolFuture = refreshDaemon.scheduleWithFixedDelay(() -> { try { refreshPool(); } catch (Throwable t) { log.warn("Failed to refresh Cassandra KVS pool." + " Extended periods of being unable to refresh will cause perf degradation.", t); } }, config.poolRefreshIntervalSeconds(), config.poolRefreshIntervalSeconds(), TimeUnit.SECONDS); // for testability, mock/spy are bad at mockability of things called in constructors if (startupChecks == StartupChecks.RUN) { runOneTimeStartupChecks(); } refreshPool(); // ensure we've initialized before returning metrics.registerAggregateMetrics(blacklist::size); }
private void tryInitialize() { cassandra.cacheInitialCassandraHosts(); refreshPoolFuture = refreshDaemon.scheduleWithFixedDelay(() -> { try { refreshPool(); } catch (Throwable t) { log.warn("Failed to refresh Cassandra KVS pool." + " Extended periods of being unable to refresh will cause perf degradation.", t); } }, config.poolRefreshIntervalSeconds(), config.poolRefreshIntervalSeconds(), TimeUnit.SECONDS); // for testability, mock/spy are bad at mockability of things called in constructors if (startupChecks == StartupChecks.RUN) { runOneTimeStartupChecks(); } refreshPool(); // ensure we've initialized before returning metrics.registerAggregateMetrics(blacklist::size); }