com.netflix.astyanax.connectionpool.impl
Class BagOfConnectionsConnectionPoolImpl<CL>
java.lang.Object
com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool<CL>
com.netflix.astyanax.connectionpool.impl.BagOfConnectionsConnectionPoolImpl<CL>
- Type Parameters:
CL -
- All Implemented Interfaces:
- ConnectionPool<CL>, SimpleHostConnectionPool.Listener<CL>
public class BagOfConnectionsConnectionPoolImpl<CL>
- extends AbstractHostPartitionConnectionPool<CL>
Connection pool which puts all connections in a single queue. The load
balancing is essentially random here.
The class consults Topology for all the pools and then selects a pool at random using randomIndex
For AbstractHostPartitionConnectionPool.executeWithFailover(Operation, com.netflix.astyanax.retry.RetryPolicy) it just fails over to the next pool in the list of pools
starting at the random index.
- See Also:
AbstractHostPartitionConnectionPool} for the base class that provides the rest of the functionality,
Topology} and {@link TokenPartitionedTopology} for details on where this class gets it list of host connection pools to randomly index over
| Methods inherited from class com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool |
addHost, executeWithFailover, getActivePools, getHostPool, getPartitioner, getPools, getTopology, hasHost, isHostUp, newHostConnectionPool, onHostDown, onHostUp, rebuildPartitions, removeHost, setHosts, shutdown, start |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BagOfConnectionsConnectionPoolImpl
public BagOfConnectionsConnectionPoolImpl(ConnectionPoolConfiguration config,
ConnectionFactory<CL> factory,
ConnectionPoolMonitor monitor)
- Parameters:
config - factory - monitor -
returnConnection
protected boolean returnConnection(Connection<CL> connection)
newExecuteWithFailover
public <R> ExecuteWithFailover<CL,R> newExecuteWithFailover(Operation<CL,R> op)
throws ConnectionException
- Description copied from class:
AbstractHostPartitionConnectionPool
- Return a new failover context. The context captures the connection pool
state and implements the necessary failover logic.
- Specified by:
newExecuteWithFailover in class AbstractHostPartitionConnectionPool<CL>
- Returns:
-
- Throws:
ConnectionException