@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { pool = pools.get(getNextHostIndex()); return pool.borrowConnection(waitDelta * waitMultiplier); }
@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { pool = pools.get(getNextHostIndex()); return pool.borrowConnection(waitDelta * waitMultiplier); }
@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { // find the pool with the least outstanding (i.e most idle) active connections Iterator<HostConnectionPool<CL>> iterator = this.pools.iterator(); HostConnectionPool eligible = iterator.next(); while (iterator.hasNext()) { HostConnectionPool<CL> candidate = iterator.next(); if (candidate.getIdleConnectionCount() > eligible.getIdleConnectionCount()) { eligible = candidate; } } return eligible.borrowConnection(waitDelta * waitMultiplier); }
@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { // find the pool with the least outstanding (i.e most idle) active connections Iterator<HostConnectionPool<CL>> iterator = this.pools.iterator(); HostConnectionPool eligible = iterator.next(); while (iterator.hasNext()) { HostConnectionPool<CL> candidate = iterator.next(); if (candidate.getIdleConnectionCount() > eligible.getIdleConnectionCount()) { eligible = candidate; } } return eligible.borrowConnection(waitDelta * waitMultiplier); }
@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; }