|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.memcached.compat.SpyObject
net.spy.memcached.MemcachedClient
net.spy.memcached.MembaseClient
public class MembaseClient
| Field Summary | |
|---|---|
protected boolean |
reconfiguring
|
| Fields inherited from class net.spy.memcached.MemcachedClient |
|---|
authDescriptor, authMonitor, connFactory, mconn, operationTimeout, opFact, shuttingDown, tcService, transcoder |
| Fields inherited from interface net.spy.memcached.MemcachedClientIF |
|---|
MAX_KEY_LENGTH |
| Constructor Summary | |
|---|---|
|
MembaseClient(List<URI> baseList,
String bucketName,
String pwd)
Get a MembaseClient based on the REST response from a Membase server. |
|
MembaseClient(List<URI> baseList,
String bucketName,
String usr,
String pwd)
Get a MembaseClient based on the REST response from a Membase server where the username is different than the bucket name. |
|
MembaseClient(MembaseConnectionFactory cf)
Get a MembaseClient based on the REST response from a Membase server where the username is different than the bucket name. |
protected |
MembaseClient(MembaseConnectionFactory cf,
boolean subscribe)
Get a MembaseClient based on the REST response from a Membase server where the username is different than the bucket name. |
| Method Summary | ||
|---|---|---|
OperationFuture<CASValue<Object>> |
asyncGetAndLock(String key,
int exp)
Get and lock the given key asynchronously and decode with the default transcoder. |
|
|
asyncGetAndLock(String key,
int exp,
Transcoder<T> tc)
Gets and locks the given key asynchronously. |
|
CASValue<Object> |
getAndLock(String key,
int exp)
Get and lock with a single key and decode using the default transcoder. |
|
|
getAndLock(String key,
int exp,
Transcoder<T> tc)
Getl with a single key. |
|
void |
reconfigure(Bucket bucket)
This function is called when there is a topology change in the cluster. |
|
boolean |
shutdown(long timeout,
TimeUnit unit)
Shut down this client gracefully. |
|
| Methods inherited from class net.spy.memcached.MemcachedClient |
|---|
add, add, addObserver, append, append, asyncCAS, asyncCAS, asyncCAS, asyncDecr, asyncGet, asyncGet, asyncGetAndTouch, asyncGetAndTouch, asyncGetBulk, asyncGetBulk, asyncGetBulk, asyncGetBulk, asyncGetBulk, asyncGets, asyncGets, asyncIncr, cas, cas, cas, connectionEstablished, connectionLost, decr, decr, decr, delete, delete, flush, flush, get, get, getAndTouch, getAndTouch, getAvailableServers, getBulk, getBulk, getBulk, getBulk, getNodeLocator, gets, gets, getStats, getStats, getTranscoder, getUnavailableServers, getVersions, incr, incr, incr, listSaslMechanisms, prepend, prepend, removeObserver, replace, replace, set, set, shutdown, touch, touch, waitForQueues |
| Methods inherited from class net.spy.memcached.compat.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.spy.memcached.MemcachedClientIF |
|---|
add, add, addObserver, append, append, asyncCAS, asyncCAS, asyncDecr, asyncGet, asyncGet, asyncGetAndTouch, asyncGetAndTouch, asyncGetBulk, asyncGetBulk, asyncGetBulk, asyncGetBulk, asyncGetBulk, asyncGets, asyncGets, asyncIncr, cas, cas, decr, decr, decr, delete, flush, flush, get, get, getAndTouch, getAndTouch, getAvailableServers, getBulk, getBulk, getBulk, getBulk, getNodeLocator, gets, gets, getStats, getStats, getTranscoder, getUnavailableServers, getVersions, incr, incr, incr, listSaslMechanisms, prepend, prepend, removeObserver, replace, replace, set, set, shutdown, touch, touch, waitForQueues |
| Field Detail |
|---|
protected volatile boolean reconfiguring
| Constructor Detail |
|---|
public MembaseClient(List<URI> baseList,
String bucketName,
String pwd)
throws IOException,
ConfigurationException
baseList - the URI list of one or more servers from the clusterbucketName - the bucket name in the cluster you wish to usepwd - the password for the bucket
IOException - if connections could not be made
ConfigurationException - if the configuration provided by the
server has issues or is not compatible
public MembaseClient(List<URI> baseList,
String bucketName,
String usr,
String pwd)
throws IOException,
ConfigurationException
baseList - the URI list of one or more servers from the clusterbucketName - the bucket name in the cluster you wish to useusr - the username for the bucket; this nearly always be the same
as the bucket namepwd - the password for the bucket
IOException - if connections could not be made
ConfigurationException - if the configuration provided by the
server has issues or is not compatible
public MembaseClient(MembaseConnectionFactory cf)
throws IOException,
ConfigurationException
cf - the ConnectionFactory to use to create connections
IOException - if connections could not be made
ConfigurationException - if the configuration provided by the
server has issues or is not compatible
protected MembaseClient(MembaseConnectionFactory cf,
boolean subscribe)
throws IOException,
ConfigurationException
cf - the ConnectionFactory to use to create connectionssubscribe - whether or not to subscribe to config changes
IOException - if connections could not be made
ConfigurationException - if the configuration provided by the
server has issues or is not compatible| Method Detail |
|---|
public void reconfigure(Bucket bucket)
reconfigure in interface Reconfigurablebucket - updated vbucket configuration
public <T> OperationFuture<CASValue<T>> asyncGetAndLock(String key,
int exp,
Transcoder<T> tc)
asyncGetAndLock in interface MembaseClientIFkey - the key to fetch and lockexp - the amount of time the lock should be valid for in seconds.tc - the transcoder to serialize and unserialize value
IllegalStateException - in the rare circumstance where queue
is too full to accept any more requests
public OperationFuture<CASValue<Object>> asyncGetAndLock(String key,
int exp)
asyncGetAndLock in interface MembaseClientIFkey - the key to fetch and lockexp - the amount of time the lock should be valid for in seconds.
IllegalStateException - in the rare circumstance where queue
is too full to accept any more requests
public <T> CASValue<T> getAndLock(String key,
int exp,
Transcoder<T> tc)
getAndLock in interface MembaseClientIFkey - the key to get and lockexp - the amount of time the lock should be valid for in seconds.tc - the transcoder to serialize and unserialize value
OperationTimeoutException - if the global operation timeout is
exceeded
IllegalStateException - in the rare circumstance where queue
is too full to accept any more requests
public CASValue<Object> getAndLock(String key,
int exp)
getAndLock in interface MembaseClientIFkey - the key to get and lockexp - the amount of time the lock should be valid for in seconds.
OperationTimeoutException - if the global operation timeout is
exceeded
IllegalStateException - in the rare circumstance where queue
is too full to accept any more requests
public boolean shutdown(long timeout,
TimeUnit unit)
MemcachedClient
shutdown in interface MemcachedClientIFshutdown in class MemcachedClienttimeout - the amount of time time for shutdownunit - the TimeUnit for the timeout
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||