@Override public void setHosts(Collection<Host> collection) { _delegate.setHosts(collection); }
@Override public void setHosts(Collection<Host> collection) { _delegate.setHosts(collection); }
private void update() { try { connectionPool.setHosts(hostSupplier.get()); refreshCounter.incrementAndGet(); lastUpdateTime.set(new DateTime()); } catch (Exception e) { errorCounter.incrementAndGet(); lastException.set(e); } }
private void update() { try { connectionPool.setHosts(hostSupplier.get()); refreshCounter.incrementAndGet(); lastUpdateTime.set(new DateTime()); } catch (Exception e) { errorCounter.incrementAndGet(); lastException.set(e); } }
protected <T> ConnectionPool<T> createConnectionPool(ConnectionFactory<T> connectionFactory) { ConnectionPool<T> connectionPool = null; // HACK to get the CqlFamilyFactory working with AstyanaxContext if (connectionFactory.getClass().getName().contains("CqlFamilyFactory")) { return new ConnectionPoolProxy<T>(cpConfig, connectionFactory, monitor); } switch (asConfig.getConnectionPoolType()) { case TOKEN_AWARE: connectionPool = new TokenAwareConnectionPoolImpl<T>(cpConfig, connectionFactory, monitor); break; case BAG: connectionPool = new BagOfConnectionsConnectionPoolImpl<T>(cpConfig, connectionFactory, monitor); break; case ROUND_ROBIN: default: connectionPool = new RoundRobinConnectionPoolImpl<T>(cpConfig, connectionFactory, monitor); break; } if (hostSupplier != null) { connectionPool.setHosts(hostSupplier.get()); } return connectionPool; }