public interface

HostConnectionPool

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

Class Overview

Pool of connections for a single host

Summary

Public Methods
abstract void addLatencySample(long lastLatency, long now)
Add a single latency sample after an operation on a connection belonging to this pool
abstract Connection<CL> borrowConnection(int timeout)
Borrow a connection from the host.
abstract boolean closeConnection(Connection<CL> connection)
Close this connection and update internal state
abstract int getActiveConnectionCount()
Get number of open connections including any that are currently borrowed and those that are currently idel
abstract int getBlockedThreadCount()
Get number of threads blocked waiting for a free connection
abstract int getBusyConnectionCount()
Get number of currently borrowed connections
abstract Host getHost()
Get the host to which this pool is associated
abstract int getIdleConnectionCount()
Return the number of idle active connections.
abstract double getMeanLatency()
Get the average latency as calculated by the scoring strategy
abstract int getPendingConnectionCount()
Get the number of pending connection open attempts
abstract double getScore()
Return implementation specific score to be used by weighted pool selection algorithms
abstract int growConnections(int numConnections)
Create numConnections new connections and add them to the
abstract boolean isShutdown()
Determine if pool is shut down.
abstract void markAsDown(ConnectionException reason)
Shut down the host so no more connections may be created when borrowConnections is called and connections will be terminated when returnConnection is called.
abstract Connection<CL> openConnection()
This open is different from borrowConnection in that it actually creates a new connection without waiting for one that may be idle.
abstract boolean returnConnection(Connection<CL> connection)
Return a connection to the host's pool.
abstract void shutdown()
Completely shut down this connection pool as part of a client shutdown

Public Methods

public abstract void addLatencySample (long lastLatency, long now)

Add a single latency sample after an operation on a connection belonging to this pool

public abstract Connection<CL> borrowConnection (int timeout)

Borrow a connection from the host. May create a new connection if one is not available.@return

public abstract boolean closeConnection (Connection<CL> connection)

Close this connection and update internal state

public abstract int getActiveConnectionCount ()

Get number of open connections including any that are currently borrowed and those that are currently idel

public abstract int getBlockedThreadCount ()

Get number of threads blocked waiting for a free connection

public abstract int getBusyConnectionCount ()

Get number of currently borrowed connections

public abstract Host getHost ()

Get the host to which this pool is associated

public abstract int getIdleConnectionCount ()

Return the number of idle active connections. These are connections that can be borrowed immediatley without having to make a new connection to the remote server.

public abstract double getMeanLatency ()

Get the average latency as calculated by the scoring strategy

public abstract int getPendingConnectionCount ()

Get the number of pending connection open attempts

public abstract double getScore ()

Return implementation specific score to be used by weighted pool selection algorithms

public abstract int growConnections (int numConnections)

Create numConnections new connections and add them to the

Throws
ConnectionException
InterruptedException
ConnectionException
InterruptedException

public abstract boolean isShutdown ()

Determine if pool is shut down.

public abstract void markAsDown (ConnectionException reason)

Shut down the host so no more connections may be created when borrowConnections is called and connections will be terminated when returnConnection is called.

public abstract Connection<CL> openConnection ()

This open is different from borrowConnection in that it actually creates a new connection without waiting for one that may be idle. openConnection is still subject to all other connection pool limitations.@return

public abstract boolean returnConnection (Connection<CL> connection)

Return a connection to the host's pool. May close the connection if the pool is down or the last exception on the connection is determined to be fatal.

Returns
  • True if connection was closed

public abstract void shutdown ()

Completely shut down this connection pool as part of a client shutdown