public class TapConnectionProvider extends SpyObject implements ConnectionObserver
Modifier and Type | Field and Description |
---|---|
protected AuthDescriptor |
authDescriptor |
protected AuthThreadMonitor |
authMonitor |
protected MemcachedConnection |
conn |
protected OperationFactory |
opFact |
protected boolean |
shuttingDown |
protected TranscodeService |
tcService |
Constructor and Description |
---|
TapConnectionProvider(ConnectionFactory cf,
List<InetSocketAddress> addrs)
Get a tap client operating on the specified memcached locations.
|
TapConnectionProvider(InetSocketAddress... ia)
Get a tap client operating on the specified memcached locations.
|
TapConnectionProvider(List<InetSocketAddress> addrs)
Get a tap client operating on the specified memcached locations.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addObserver(ConnectionObserver obs)
Add a connection observer.
|
void |
addTapAckOp(MemcachedNode node,
Operation op) |
CountDownLatch |
broadcastOp(BroadcastOpFactory of) |
void |
connectionEstablished(SocketAddress sa,
int reconnectCount)
A connection has just successfully been established on the given socket.
|
void |
connectionLost(SocketAddress sa)
A connection was just lost on the given socket.
|
OperationFactory |
getOpFactory() |
boolean |
removeObserver(ConnectionObserver obs)
Remove a connection observer.
|
void |
shutdown()
Shut down immediately.
|
boolean |
shutdown(long timeout,
TimeUnit unit)
Shut down this client gracefully.
|
boolean |
waitForQueues(long timeout,
TimeUnit unit)
Wait for the queues to die down.
|
protected volatile boolean shuttingDown
protected final MemcachedConnection conn
protected final OperationFactory opFact
protected final TranscodeService tcService
protected final AuthDescriptor authDescriptor
protected final AuthThreadMonitor authMonitor
public TapConnectionProvider(InetSocketAddress... ia) throws IOException
ia
- the memcached locationsIOException
- if connections cannot be establishedpublic TapConnectionProvider(List<InetSocketAddress> addrs) throws IOException
addrs
- the socket addrsIOException
- if connections cannot be establishedpublic TapConnectionProvider(ConnectionFactory cf, List<InetSocketAddress> addrs) throws IOException
cf
- the connection factory to configure connections for this clientaddrs
- the socket addressesIOException
- if connections cannot be establishedpublic void addTapAckOp(MemcachedNode node, Operation op)
public CountDownLatch broadcastOp(BroadcastOpFactory of)
public boolean addObserver(ConnectionObserver obs)
obs
- the ConnectionObserver you wish to addpublic boolean removeObserver(ConnectionObserver obs)
obs
- the ConnectionObserver you wish to addpublic void connectionEstablished(SocketAddress sa, int reconnectCount)
ConnectionObserver
connectionEstablished
in interface ConnectionObserver
sa
- the address of the node whose connection was establishedreconnectCount
- the number of attempts before the connection was
establishedpublic void connectionLost(SocketAddress sa)
ConnectionObserver
connectionLost
in interface ConnectionObserver
sa
- the address of the node whose connection was lostpublic void shutdown()
public boolean shutdown(long timeout, TimeUnit unit)
timeout
- the amount of time for shutdownunit
- the TimeUnit for the timeoutpublic boolean waitForQueues(long timeout, TimeUnit unit)
timeout
- the amount of time time for shutdownunit
- the TimeUnit for the timeoutIllegalStateException
- in the rare circumstance where queue is too
full to accept any more requestspublic OperationFactory getOpFactory()
Copyright © 2024. All rights reserved.