public LeastOutstandingExecuteWithFailover(ConnectionPoolConfiguration config, ConnectionPoolMonitor monitor, List<HostConnectionPool<CL>> pools) throws ConnectionException { super(config, monitor); this.pools = Lists.newArrayList(pools); if (this.pools == null || this.pools.isEmpty()) { throw new NoAvailableHostsException("No hosts to borrow from"); } int size = this.pools.size(); retryCountdown = Math.min(config.getMaxFailoverCount(), size); if (retryCountdown < 0) retryCountdown = size; else if (retryCountdown == 0) retryCountdown = 1; waitDelta = config.getMaxTimeoutWhenExhausted() / retryCountdown; }
public LeastOutstandingExecuteWithFailover(ConnectionPoolConfiguration config, ConnectionPoolMonitor monitor, List<HostConnectionPool<CL>> pools) throws ConnectionException { super(config, monitor); this.pools = Lists.newArrayList(pools); if (this.pools == null || this.pools.isEmpty()) { throw new NoAvailableHostsException("No hosts to borrow from"); } int size = this.pools.size(); retryCountdown = Math.min(config.getMaxFailoverCount(), size); if (retryCountdown < 0) retryCountdown = size; else if (retryCountdown == 0) retryCountdown = 1; waitDelta = config.getMaxTimeoutWhenExhausted() / retryCountdown; }
public RoundRobinExecuteWithFailover(ConnectionPoolConfiguration config, ConnectionPoolMonitor monitor, List<HostConnectionPool<CL>> pools, int index) throws ConnectionException { super(config, monitor); this.index = index; this.pools = pools; if (pools == null || pools.isEmpty()) { throw new NoAvailableHostsException("No hosts to borrow from"); } size = pools.size(); retryCountdown = Math.min(config.getMaxFailoverCount(), size); if (retryCountdown < 0) retryCountdown = size; else if (retryCountdown == 0) retryCountdown = 1; waitDelta = config.getMaxTimeoutWhenExhausted() / retryCountdown; }
public RoundRobinExecuteWithFailover(ConnectionPoolConfiguration config, ConnectionPoolMonitor monitor, List<HostConnectionPool<CL>> pools, int index) throws ConnectionException { super(config, monitor); this.index = index; this.pools = pools; if (pools == null || pools.isEmpty()) { throw new NoAvailableHostsException("No hosts to borrow from"); } size = pools.size(); retryCountdown = Math.min(config.getMaxFailoverCount(), size); if (retryCountdown < 0) retryCountdown = size; else if (retryCountdown == 0) retryCountdown = 1; waitDelta = config.getMaxTimeoutWhenExhausted() / retryCountdown; }
@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { pool = null; connection = BagOfConnectionsConnectionPoolImpl.this.borrowConnection(operation); pool = connection.getHostConnectionPool(); return connection; }
@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { pool = null; connection = BagOfConnectionsConnectionPoolImpl.this.borrowConnection(operation); pool = connection.getHostConnectionPool(); return connection; }