public interface

ConnectionPool

com.netflix.astyanax.connectionpool.ConnectionPool<CL>
Known Indirect Subclasses

Class Overview

Base interface for a pool of connections. A concrete connection pool will track hosts in a cluster.

Summary

Public Methods
abstract boolean addHost(Host host, boolean refresh)
Add a host to the connection pool.
abstract <R> OperationResult<R> executeWithFailover(Operation<CL, R> op, RetryPolicy retry)
Execute an operation with failover within the context of the connection pool.
abstract List<HostConnectionPool<CL>> getActivePools()
Return list of active hosts on which connections can be created
abstract HostConnectionPool<CL> getHostPool(Host host)
Return an immutable connection pool for this host
abstract boolean hasHost(Host host)
Return true if host is contained within the connection pool
abstract boolean isHostUp(Host host)
Return true if the host is up
abstract boolean removeHost(Host host, boolean refresh)
Remove a host from the connection pool.
abstract void setHosts(Map<BigIntegerList<Host>> ring)
Sets the complete set of hosts keyed by token.
abstract void shutdown()
Shut down the connection pool and terminate all existing connections
abstract void start()
Setup the connection pool and start any maintenance threads

Public Methods

public abstract boolean addHost (Host host, boolean refresh)

Add a host to the connection pool.

public abstract OperationResult<R> executeWithFailover (Operation<CL, R> op, RetryPolicy retry)

Execute an operation with failover within the context of the connection pool. The operation will only fail over for connection pool errors and not application errors.@return

Throws
ConnectionException
OperationException
ConnectionException

public abstract List<HostConnectionPool<CL>> getActivePools ()

Return list of active hosts on which connections can be created

public abstract HostConnectionPool<CL> getHostPool (Host host)

Return an immutable connection pool for this host

public abstract boolean hasHost (Host host)

Return true if host is contained within the connection pool

public abstract boolean isHostUp (Host host)

Return true if the host is up

public abstract boolean removeHost (Host host, boolean refresh)

Remove a host from the connection pool. Any pending connections will be allowed to complete

public abstract void setHosts (Map<BigIntegerList<Host>> ring)

Sets the complete set of hosts keyed by token.

public abstract void shutdown ()

Shut down the connection pool and terminate all existing connections

public abstract void start ()

Setup the connection pool and start any maintenance threads