public class TestConnectionPool extends java.lang.Object implements ConnectionPool<TestClient>
| Constructor and Description |
|---|
TestConnectionPool() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addHost(Host host,
boolean refresh)
Add a host to the connection pool.
|
<R> OperationResult<R> |
executeWithFailover(Operation<TestClient,R> op,
RetryPolicy retry)
Execute an operation with failover within the context of the connection
pool.
|
java.util.List<HostConnectionPool<TestClient>> |
getActivePools() |
HostConnectionPool<TestClient> |
getHostPool(Host host) |
java.util.Collection<Host> |
getHosts() |
Partitioner |
getPartitioner() |
java.util.List<HostConnectionPool<TestClient>> |
getPools() |
Topology<TestClient> |
getTopology() |
boolean |
hasHost(Host host) |
boolean |
isHostUp(Host host) |
boolean |
removeHost(Host host,
boolean refresh)
Remove a host from the connection pool.
|
void |
setHosts(java.util.Collection<Host> ring)
Set the complete set of hosts in the ring
|
void |
shutdown()
Shut down the connection pool and terminate all existing connections
|
void |
start()
Setup the connection pool and start any maintenance threads
|
public java.util.Collection<Host> getHosts()
public boolean addHost(Host host, boolean refresh)
ConnectionPooladdHost in interface ConnectionPool<TestClient>public boolean removeHost(Host host, boolean refresh)
ConnectionPoolremoveHost in interface ConnectionPool<TestClient>public void setHosts(java.util.Collection<Host> ring)
ConnectionPoolsetHosts in interface ConnectionPool<TestClient>public <R> OperationResult<R> executeWithFailover(Operation<TestClient,R> op, RetryPolicy retry) throws ConnectionException, OperationException
ConnectionPoolexecuteWithFailover in interface ConnectionPool<TestClient>ConnectionExceptionOperationExceptionpublic void shutdown()
ConnectionPoolshutdown in interface ConnectionPool<TestClient>public void start()
ConnectionPoolstart in interface ConnectionPool<TestClient>public boolean isHostUp(Host host)
isHostUp in interface ConnectionPool<TestClient>public boolean hasHost(Host host)
hasHost in interface ConnectionPool<TestClient>public HostConnectionPool<TestClient> getHostPool(Host host)
getHostPool in interface ConnectionPool<TestClient>public java.util.List<HostConnectionPool<TestClient>> getActivePools()
getActivePools in interface ConnectionPool<TestClient>public java.util.List<HostConnectionPool<TestClient>> getPools()
getPools in interface ConnectionPool<TestClient>public Topology<TestClient> getTopology()
getTopology in interface ConnectionPool<TestClient>public Partitioner getPartitioner()
getPartitioner in interface ConnectionPool<TestClient>