CL - R - public class RoundRobinExecuteWithFailover<CL,R> extends AbstractExecuteWithFailoverImpl<CL,R>
AbstractExecuteWithFailoverImpl to provide functionality for borrowing a Connection from a list of HostConnectionPool(s)
in a round robin fashion. ConnectionPoolConfiguration.getMaxFailoverCount() threshold.AbstractExecuteWithFailoverImpl} for details on how failover is repeatedly called for ensuring that an {@link Operation} can be executed with resiliency.,
RoundRobinConnectionPoolImpl} for the impl that references this class.,
AbstractHostPartitionConnectionPool} for more context on how failover functionality is used within the context of an operation execution| Modifier and Type | Field and Description |
|---|---|
protected HostConnectionPool<CL> |
pool |
protected java.util.List<HostConnectionPool<CL>> |
pools |
protected int |
size |
protected int |
waitDelta |
protected int |
waitMultiplier |
config, connection| Constructor and Description |
|---|
RoundRobinExecuteWithFailover(ConnectionPoolConfiguration config,
ConnectionPoolMonitor monitor,
java.util.List<HostConnectionPool<CL>> pools,
int index) |
| Modifier and Type | Method and Description |
|---|---|
Connection<CL> |
borrowConnection(Operation<CL,R> operation) |
boolean |
canRetry() |
HostConnectionPool<CL> |
getCurrentHostConnectionPool() |
int |
getNextHostIndex() |
getCurrentHost, releaseConnection, tryOperationprotected HostConnectionPool<CL> pool
protected final java.util.List<HostConnectionPool<CL>> pools
protected final int size
protected int waitDelta
protected int waitMultiplier
public RoundRobinExecuteWithFailover(ConnectionPoolConfiguration config, ConnectionPoolMonitor monitor, java.util.List<HostConnectionPool<CL>> pools, int index) throws ConnectionException
ConnectionExceptionpublic int getNextHostIndex()
public boolean canRetry()
canRetry in class AbstractExecuteWithFailoverImpl<CL,R>public HostConnectionPool<CL> getCurrentHostConnectionPool()
getCurrentHostConnectionPool in class AbstractExecuteWithFailoverImpl<CL,R>HostConnectionPoolpublic Connection<CL> borrowConnection(Operation<CL,R> operation) throws ConnectionException
borrowConnection in class AbstractExecuteWithFailoverImpl<CL,R>ConnectionConnectionException