|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool<CL>
CL
- public abstract class AbstractHostPartitionConnectionPool<CL>
Base for all connection pools that keep a separate pool of connections for each host.
Field Summary | |
---|---|
protected ConnectionPoolConfiguration |
config
|
protected ConnectionFactory<CL> |
factory
|
protected org.cliffc.high_scale_lib.NonBlockingHashMap<Host,HostConnectionPool<CL>> |
hosts
|
protected ConnectionPoolMonitor |
monitor
|
protected Topology<CL> |
topology
|
Constructor Summary | |
---|---|
AbstractHostPartitionConnectionPool(ConnectionPoolConfiguration config,
ConnectionFactory<CL> factory,
ConnectionPoolMonitor monitor)
|
Method Summary | ||
---|---|---|
boolean |
addHost(Host host,
boolean refresh)
Add a host to the connection pool. |
|
|
executeWithFailover(Operation<CL,R> op,
RetryPolicy retry)
Execute an operation with failover within the context of the connection pool. |
|
List<HostConnectionPool<CL>> |
getActivePools()
Return list of active hosts on which connections can be created |
|
HostConnectionPool<CL> |
getHostPool(Host host)
Return an immutable connection pool for this host |
|
boolean |
hasHost(Host host)
Return true if host is contained within the connection pool |
|
boolean |
isHostUp(Host host)
Return true if the host is up |
|
protected abstract
|
newExecuteWithFailover(Operation<CL,R> op)
Return a new failover context. |
|
protected HostConnectionPool<CL> |
newHostConnectionPool(Host host,
ConnectionFactory<CL> factory,
ConnectionPoolConfiguration config)
|
|
void |
onHostDown(HostConnectionPool<CL> pool)
|
|
void |
onHostUp(HostConnectionPool<CL> pool)
|
|
protected void |
rebuildPartitions()
Called every time a host is added, removed or is marked as down |
|
boolean |
removeHost(Host host,
boolean refresh)
Remove a host from the connection pool. |
|
void |
setHosts(Map<BigInteger,List<Host>> ring)
Sets the complete set of hosts keyed by token. |
|
void |
shutdown()
Shut down the connection pool and terminate all existing connections |
|
void |
start()
Setup the connection pool and start any maintenance threads |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.cliffc.high_scale_lib.NonBlockingHashMap<Host,HostConnectionPool<CL>> hosts
protected final ConnectionPoolConfiguration config
protected final ConnectionFactory<CL> factory
protected final ConnectionPoolMonitor monitor
protected final Topology<CL> topology
Constructor Detail |
---|
public AbstractHostPartitionConnectionPool(ConnectionPoolConfiguration config, ConnectionFactory<CL> factory, ConnectionPoolMonitor monitor)
Method Detail |
---|
public void start()
ConnectionPool
start
in interface ConnectionPool<CL>
public void shutdown()
ConnectionPool
shutdown
in interface ConnectionPool<CL>
protected HostConnectionPool<CL> newHostConnectionPool(Host host, ConnectionFactory<CL> factory, ConnectionPoolConfiguration config)
public void onHostDown(HostConnectionPool<CL> pool)
onHostDown
in interface SimpleHostConnectionPool.Listener<CL>
public void onHostUp(HostConnectionPool<CL> pool)
onHostUp
in interface SimpleHostConnectionPool.Listener<CL>
public final boolean addHost(Host host, boolean refresh)
ConnectionPool
addHost
in interface ConnectionPool<CL>
public boolean isHostUp(Host host)
ConnectionPool
isHostUp
in interface ConnectionPool<CL>
public boolean hasHost(Host host)
ConnectionPool
hasHost
in interface ConnectionPool<CL>
public List<HostConnectionPool<CL>> getActivePools()
ConnectionPool
getActivePools
in interface ConnectionPool<CL>
public boolean removeHost(Host host, boolean refresh)
ConnectionPool
removeHost
in interface ConnectionPool<CL>
public HostConnectionPool<CL> getHostPool(Host host)
ConnectionPool
getHostPool
in interface ConnectionPool<CL>
public void setHosts(Map<BigInteger,List<Host>> ring)
ConnectionPool
setHosts
in interface ConnectionPool<CL>
public <R> OperationResult<R> executeWithFailover(Operation<CL,R> op, RetryPolicy retry) throws ConnectionException
ConnectionPool
executeWithFailover
in interface ConnectionPool<CL>
ConnectionException
OperationException
protected abstract <R> ExecuteWithFailover<CL,R> newExecuteWithFailover(Operation<CL,R> op) throws ConnectionException
R
-
ConnectionException
protected void rebuildPartitions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |