com.netflix.astyanax.connectionpool.impl
Class LeastOutstandingExecuteWithFailover<CL,R>

java.lang.Object
  extended by com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl<CL,R>
      extended by com.netflix.astyanax.connectionpool.impl.LeastOutstandingExecuteWithFailover<CL,R>
Type Parameters:
CL -
R -
All Implemented Interfaces:
ExecuteWithFailover<CL,R>

public class LeastOutstandingExecuteWithFailover<CL,R>
extends AbstractExecuteWithFailoverImpl<CL,R>

Finds the HostConnectionPool with the max idle connections when borrowing a connection from the pool. This execute with failover impl is used within the TokenAwareConnectionPoolImpl class depending on the configured HostSelectorStrategy

See Also:
TokenAwareConnectionPoolImpl#executeWithFailover(Operation, com.netflix.astyanax.retry.RetryPolicy)} for details on where this class is referenced

Field Summary
protected  HostConnectionPool<CL> pool
           
protected  java.util.List<HostConnectionPool<CL>> pools
           
protected  int waitDelta
           
protected  int waitMultiplier
           
 
Fields inherited from class com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl
config, connection
 
Constructor Summary
LeastOutstandingExecuteWithFailover(ConnectionPoolConfiguration config, ConnectionPoolMonitor monitor, java.util.List<HostConnectionPool<CL>> pools)
           
 
Method Summary
 Connection<CL> borrowConnection(Operation<CL,R> operation)
           
 boolean canRetry()
           
 HostConnectionPool<CL> getCurrentHostConnectionPool()
           
 
Methods inherited from class com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl
getCurrentHost, releaseConnection, tryOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

protected HostConnectionPool<CL> pool

pools

protected final java.util.List<HostConnectionPool<CL>> pools

waitDelta

protected int waitDelta

waitMultiplier

protected int waitMultiplier
Constructor Detail

LeastOutstandingExecuteWithFailover

public LeastOutstandingExecuteWithFailover(ConnectionPoolConfiguration config,
                                           ConnectionPoolMonitor monitor,
                                           java.util.List<HostConnectionPool<CL>> pools)
                                    throws ConnectionException
Throws:
ConnectionException
Method Detail

canRetry

public boolean canRetry()
Specified by:
canRetry in class AbstractExecuteWithFailoverImpl<CL,R>
Returns:
boolean

getCurrentHostConnectionPool

public HostConnectionPool<CL> getCurrentHostConnectionPool()
Specified by:
getCurrentHostConnectionPool in class AbstractExecuteWithFailoverImpl<CL,R>
Returns:
HostConnectionPool

borrowConnection

public Connection<CL> borrowConnection(Operation<CL,R> operation)
                                throws ConnectionException
Specified by:
borrowConnection in class AbstractExecuteWithFailoverImpl<CL,R>
Returns:
Connection
Throws:
ConnectionException