public class TapClient extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
messagesRead |
protected HashMap<TapStream,TapConnectionProvider> |
omap |
protected BlockingQueue<Object> |
rqueue |
Constructor and Description |
---|
TapClient(InetSocketAddress... ia)
Creates a tap client against the specified servers.
|
TapClient(List<InetSocketAddress> addrs)
Creates a tap client against the specified servers.
|
Modifier and Type | Method and Description |
---|---|
long |
getMessagesRead()
The number of messages read by all of the tap streams created with this
client.
|
ResponseMessage |
getNextMessage()
Gets the next tap message from the queue of received tap messages.
|
ResponseMessage |
getNextMessage(long time,
TimeUnit timeunit)
Gets the next tap message from the queue of received tap messages.
|
boolean |
hasMoreMessages()
Decides whether the client has received tap messages or will receive more
messages in the future.
|
void |
shutdown()
Shuts down all tap streams that are currently running.
|
TapStream |
tapCustom(String id,
RequestMessage message)
Allows the user to specify a custom tap message.
|
TapStream |
tapDump(String id)
Specifies a tap stream that will take a snapshot of items in memcached and
send them through a tap stream.
|
protected BlockingQueue<Object> rqueue
protected final HashMap<TapStream,TapConnectionProvider> omap
protected long messagesRead
public TapClient(InetSocketAddress... ia)
ia
- the addresses of each node in the cluster.public TapClient(List<InetSocketAddress> addrs)
addrs
- a list of addresses containing each node in the cluster.public ResponseMessage getNextMessage()
public ResponseMessage getNextMessage(long time, TimeUnit timeunit)
time
- the amount of time to wait for a message.timeunit
- the unit of time to use.public boolean hasMoreMessages()
public TapStream tapCustom(String id, RequestMessage message) throws ConfigurationException, IOException
id
- the named tap id that can be used to resume a disconnected tap
streammessage
- the custom tap message that will be used to initiate the tap
stream.ConfigurationException
- a bad configuration was received from the
memcached cluster.IOException
- if there are errors connecting to the cluster.public TapStream tapDump(String id) throws IOException, ConfigurationException
id
- the named tap id that can be used to resume a disconnected tap
streamConfigurationException
- a bad configuration was received from the
memcached cluster.IOException
- If there are errors connecting to the cluster.public void shutdown()
public long getMessagesRead()
Copyright © 2023. All rights reserved.