public class TapClient
extends net.spy.memcached.TapClient
Constructor and Description |
---|
TapClient(java.util.List<java.net.URI> baseList,
java.lang.String bucketName,
java.lang.String pwd)
Creates a cluster aware tap client for Couchbase Server.
|
Modifier and Type | Method and Description |
---|---|
long |
getMessagesRead()
The number of messages read by all of the tap streams created with this
client.
|
net.spy.memcached.tapmessage.ResponseMessage |
getNextMessage()
Gets the next tap message from the queue of received tap messages.
|
net.spy.memcached.tapmessage.ResponseMessage |
getNextMessage(long time,
java.util.concurrent.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.
|
net.spy.memcached.tapmessage.TapStream |
tapBackfill(java.lang.String id,
int runTime,
java.util.concurrent.TimeUnit timeunit)
Specifies a tap stream that will send all key-value mutations that take
place in the future.
|
net.spy.memcached.tapmessage.TapStream |
tapBackfill(java.lang.String id,
long date,
int runTime,
java.util.concurrent.TimeUnit timeunit)
Specifies a tap stream that will send all key-value mutations that took
place after a specific date.
|
net.spy.memcached.tapmessage.TapStream |
tapCustom(java.lang.String id,
net.spy.memcached.tapmessage.RequestMessage message)
Allows the user to specify a custom tap message.
|
net.spy.memcached.tapmessage.TapStream |
tapDump(java.lang.String id)
Specifies a tap stream that will take a snapshot of items in Couchbase and
send them through a tap stream.
|
public TapClient(java.util.List<java.net.URI> baseList, java.lang.String bucketName, java.lang.String pwd)
baseList
- a list of servers to get the cluster configuration from.bucketName
- the name of the bucket to tap.pwd
- the buckets password.public net.spy.memcached.tapmessage.ResponseMessage getNextMessage()
getNextMessage
in class net.spy.memcached.TapClient
public net.spy.memcached.tapmessage.ResponseMessage getNextMessage(long time, java.util.concurrent.TimeUnit timeunit)
getNextMessage
in class net.spy.memcached.TapClient
time
- the amount of time to wait for a message.timeunit
- the unit of time to use.public boolean hasMoreMessages()
hasMoreMessages
in class net.spy.memcached.TapClient
public net.spy.memcached.tapmessage.TapStream tapCustom(java.lang.String id, net.spy.memcached.tapmessage.RequestMessage message) throws javax.naming.ConfigurationException, java.io.IOException
tapCustom
in class net.spy.memcached.TapClient
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.javax.naming.ConfigurationException
- a bad configuration was received from the
Couchbase cluster.java.io.IOException
- if there are errors connecting to the cluster.public net.spy.memcached.tapmessage.TapStream tapBackfill(java.lang.String id, int runTime, java.util.concurrent.TimeUnit timeunit) throws java.io.IOException, javax.naming.ConfigurationException
id
- the named tap id that can be used to resume a disconnected tap
streamrunTime
- the amount of time to do backfill for. Set to 0 for infinite
backfill.timeunit
- the unit of time for the runtime parameter.javax.naming.ConfigurationException
- a bad configuration was received from the
Couchbase cluster.java.io.IOException
- If there are errors connecting to the cluster.public net.spy.memcached.tapmessage.TapStream tapBackfill(java.lang.String id, long date, int runTime, java.util.concurrent.TimeUnit timeunit) throws java.io.IOException, javax.naming.ConfigurationException
id
- the named tap id that can be used to resume a disconnected tap
streamdate
- the date to begin sending key mutations from. Specify -1 to
send all future key-value mutations.runTime
- the amount of time to do backfill for. Set to 0 for infinite
backfill.timeunit
- the unit of time for the runtime parameter.javax.naming.ConfigurationException
- a bad configuration was received from the
Couchbase cluster.java.io.IOException
- If there are errors connecting to the cluster.public net.spy.memcached.tapmessage.TapStream tapDump(java.lang.String id) throws java.io.IOException, javax.naming.ConfigurationException
tapDump
in class net.spy.memcached.TapClient
id
- the named tap id that can be used to resume a disconnected tap
streamjavax.naming.ConfigurationException
- a bad configuration was received from the
Couchbase cluster.java.io.IOException
- If there are errors connecting to the cluster.public void shutdown()
shutdown
in class net.spy.memcached.TapClient
public long getMessagesRead()
getMessagesRead
in class net.spy.memcached.TapClient
Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.