public class

TestHostConnectionPool

extends Object
implements HostConnectionPool<CL>
java.lang.Object
   ↳ com.netflix.astyanax.test.TestHostConnectionPool

Summary

Public Constructors
TestHostConnectionPool(Host host)
Public Methods
void addLatencySample(long lastLatency, long now)
Add a single latency sample after an operation on a connection belonging to this pool
Connection<TestClient> borrowConnection(int timeout)
Borrow a connection from the host.
boolean closeConnection(Connection<TestClient> connection)
int getActiveConnectionCount()
Get number of open connections including any that are currently borrowed and those that are currently idel
int getBlockedThreadCount()
Get number of threads blocked waiting for a free connection
int getBusyConnectionCount()
Get number of currently borrowed connections
Host getHost()
Get the host to which this pool is associated
int getIdleConnectionCount()
Return the number of idle active connections.
double getMeanLatency()
Get the average latency as calculated by the scoring strategy
int getPendingConnectionCount()
Get the number of pending connection open attempts
double getScore()
Return implementation specific score to be used by weighted pool selection algorithms
int growConnections(int numConnections)
Create numConnections new connections and add them to the
boolean isShutdown()
Determine if pool is shut down.
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.
Connection<TestClient> openConnection()
This open is different from borrowConnection in that it actually creates a new connection without waiting for one that may be idle.
boolean returnConnection(Connection<TestClient> connection)
void shutdown()
Completely shut down this connection pool as part of a client shutdown
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.netflix.astyanax.connectionpool.HostConnectionPool

Public Constructors

public TestHostConnectionPool (Host host)

Public Methods

public void addLatencySample (long lastLatency, long now)

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

public Connection<TestClient> borrowConnection (int timeout)

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

public boolean closeConnection (Connection<TestClient> connection)

public int getActiveConnectionCount ()

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

public int getBlockedThreadCount ()

Get number of threads blocked waiting for a free connection

public int getBusyConnectionCount ()

Get number of currently borrowed connections

public Host getHost ()

Get the host to which this pool is associated

public 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 double getMeanLatency ()

Get the average latency as calculated by the scoring strategy

public int getPendingConnectionCount ()

Get the number of pending connection open attempts

public double getScore ()

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

public int growConnections (int numConnections)

Create numConnections new connections and add them to the

public boolean isShutdown ()

Determine if pool is shut down.

public 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 Connection<TestClient> 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 boolean returnConnection (Connection<TestClient> connection)

public void shutdown ()

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