|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.astyanax.test.TestHostConnectionPool
public class TestHostConnectionPool
| Constructor Summary | |
|---|---|
TestHostConnectionPool(Host host)
|
|
| Method Summary | |
|---|---|
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)
Close this connection and update internal state |
int |
getActiveConnectionCount()
|
int |
getBlockedThreadCount()
|
int |
getBusyConnectionCount()
|
int |
getClosedConnectionCount()
|
int |
getConnectAttemptCount()
|
int |
getErrorsSinceLastSuccess()
|
int |
getFailedOpenConnectionCount()
|
Host |
getHost()
|
int |
getIdleConnectionCount()
|
int |
getOpenedConnectionCount()
|
int |
getPendingConnectionCount()
|
double |
getScore()
|
boolean |
isActive()
|
boolean |
isReconnecting()
|
boolean |
isShutdown()
|
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. |
int |
primeConnections(int numConnections)
Create numConnections new connections and add them to the |
boolean |
returnConnection(Connection<TestClient> connection)
Return a connection to the host's pool. |
void |
shutdown()
Completely shut down this connection pool as part of a client shutdown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TestHostConnectionPool(Host host)
| Method Detail |
|---|
public Connection<TestClient> borrowConnection(int timeout)
throws ConnectionException
HostConnectionPool
borrowConnection in interface HostConnectionPool<TestClient>ConnectionExceptionpublic boolean returnConnection(Connection<TestClient> connection)
HostConnectionPool
returnConnection in interface HostConnectionPool<TestClient>public void markAsDown(ConnectionException reason)
HostConnectionPool
markAsDown in interface HostConnectionPool<TestClient>public void shutdown()
HostConnectionPool
shutdown in interface HostConnectionPool<TestClient>
public int primeConnections(int numConnections)
throws ConnectionException,
java.lang.InterruptedException
HostConnectionPool
primeConnections in interface HostConnectionPool<TestClient>ConnectionException
java.lang.InterruptedExceptionpublic Host getHost()
getHost in interface HostConnectionPool<TestClient>public int getActiveConnectionCount()
getActiveConnectionCount in interface HostConnectionPool<TestClient>public int getPendingConnectionCount()
getPendingConnectionCount in interface HostConnectionPool<TestClient>public int getBlockedThreadCount()
getBlockedThreadCount in interface HostConnectionPool<TestClient>public int getIdleConnectionCount()
getIdleConnectionCount in interface HostConnectionPool<TestClient>public int getBusyConnectionCount()
getBusyConnectionCount in interface HostConnectionPool<TestClient>public boolean isReconnecting()
isReconnecting in interface HostConnectionPool<TestClient>public double getScore()
getScore in interface HostConnectionPool<TestClient>
public void addLatencySample(long lastLatency,
long now)
HostConnectionPool
addLatencySample in interface HostConnectionPool<TestClient>public boolean closeConnection(Connection<TestClient> connection)
HostConnectionPool
closeConnection in interface HostConnectionPool<TestClient>public int getOpenedConnectionCount()
getOpenedConnectionCount in interface HostConnectionPool<TestClient>public int getFailedOpenConnectionCount()
getFailedOpenConnectionCount in interface HostConnectionPool<TestClient>public int getClosedConnectionCount()
getClosedConnectionCount in interface HostConnectionPool<TestClient>public int getErrorsSinceLastSuccess()
getErrorsSinceLastSuccess in interface HostConnectionPool<TestClient>public boolean isActive()
isActive in interface HostConnectionPool<TestClient>public boolean isShutdown()
isShutdown in interface HostConnectionPool<TestClient>public int getConnectAttemptCount()
getConnectAttemptCount in interface HostConnectionPool<TestClient>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||