public class XMemcachedClient extends Object implements XMemcachedClientMBean, MemcachedClient
Modifier and Type | Field and Description |
---|---|
protected CommandFactory |
commandFactory |
protected int |
connectionPoolSize |
protected MemcachedConnector |
connector |
protected int |
maxQueuedNoReplyOperations |
static ThreadLocal<String> |
NAMESPACE_LOCAL
namespace thread local.
|
protected long |
opTimeout |
protected boolean |
resolveInetAddresses |
protected AtomicInteger |
serverOrderCount |
protected MemcachedSessionComparator |
sessionComparator |
protected MemcachedSessionLocator |
sessionLocator |
DEFAULT_CONNECT_TIMEOUT, DEFAULT_CONNECTION_POOL_SIZE, DEFAULT_HEAL_SESSION_INTERVAL, DEFAULT_MAX_QUEUED_NOPS, DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD, DEFAULT_OP_TIMEOUT, DEFAULT_READ_THREAD_COUNT, DEFAULT_SESSION_IDLE_TIMEOUT, DEFAULT_SESSION_READ_BUFF_SIZE, DEFAULT_TCP_KEEPLIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_RECV_BUFF_SIZE, DEFAULT_TCP_SEND_BUFF_SIZE, DYNAMIC_MAX_QUEUED_NOPS, MAX_QUEUED_NOPS
Constructor and Description |
---|
XMemcachedClient() |
XMemcachedClient(InetSocketAddress inetSocketAddress) |
XMemcachedClient(InetSocketAddress inetSocketAddress,
int weight) |
XMemcachedClient(InetSocketAddress inetSocketAddress,
int weight,
CommandFactory cmdFactory)
XMemcached Constructor.
|
XMemcachedClient(List<InetSocketAddress> addressList)
XMemcached Constructor.Every server's weight is one by default.
|
XMemcachedClient(List<InetSocketAddress> addressList,
CommandFactory cmdFactory)
XMemcached Constructor.Every server's weight is one by default.
|
XMemcachedClient(MemcachedSessionLocator locator,
MemcachedSessionComparator comparator,
BufferAllocator allocator,
Configuration conf,
Map<SocketOption,Object> socketOptions,
CommandFactory commandFactory,
Transcoder transcoder,
Map<InetSocketAddress,InetSocketAddress> addressMap,
List<MemcachedClientStateListener> stateListeners,
Map<InetSocketAddress,AuthInfo> map,
int poolSize,
long connectTimeout,
String name,
boolean failureMode,
boolean resolveInetAddresses)
XMemcachedClient constructor.Every server's weight is one by default.
|
XMemcachedClient(String server,
int port)
XMemcached constructor,default weight is 1
|
XMemcachedClient(String host,
int port,
int weight)
XMemcached constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(String key,
int exp,
Object value) |
boolean |
add(String key,
int exp,
Object value,
long timeout) |
<T> boolean |
add(String key,
int exp,
T value,
Transcoder<T> transcoder) |
<T> boolean |
add(String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
Add key-value item to memcached, success only when the key is not exists in memcached.
|
void |
addOneServerWithWeight(String server,
int weight)
Add a memcached server
|
void |
addServer(InetSocketAddress inetSocketAddress)
Add a memcached server,the thread call this method will be blocked until the connecting
operations completed(success or fail)
|
void |
addServer(InetSocketAddress inetSocketAddress,
int weight) |
void |
addServer(String hostList)
Add memcached servers
|
void |
addServer(String server,
int port)
Aadd a memcached server,the thread call this method will be blocked until the connecting
operations completed(success or fail)
|
void |
addServer(String server,
int port,
int weight)
add a memcached server to MemcachedClient
|
void |
addStateListener(MemcachedClientStateListener listener)
Add a memcached client listener
|
void |
addWithNoReply(String key,
int exp,
Object value)
Add key-value item to memcached, success only when the key is not exists in memcached.This
method doesn't wait for reply.
|
<T> void |
addWithNoReply(String key,
int exp,
T value,
Transcoder<T> transcoder) |
boolean |
append(String key,
Object value) |
boolean |
append(String key,
Object value,
long timeout)
Append value to key's data item,this method will wait for reply
|
void |
appendWithNoReply(String key,
Object value)
Append value to key's data item,this method doesn't wait for reply.
|
void |
beginWithNamespace(String ns)
set current namespace for following operations with memcached client.It must be ended with
MemcachedClient.endWithNamespace() method.For example: |
<T> boolean |
cas(String key,
CASOperation<T> operation) |
<T> boolean |
cas(String key,
GetsResponse<T> getsReponse,
CASOperation<T> operation) |
<T> boolean |
cas(String key,
int exp,
CASOperation<T> operation) |
<T> boolean |
cas(String key,
int exp,
CASOperation<T> operation,
Transcoder<T> transcoder)
Cas is a check and set operation which means "store this data but only if no one else has
updated since I last fetched it."
|
<T> boolean |
cas(String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation) |
<T> boolean |
cas(String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation,
Transcoder<T> transcoder)
cas is a check and set operation which means "store this data but only if no one else has
updated since I last fetched it."
|
boolean |
cas(String key,
int exp,
Object value,
long cas) |
boolean |
cas(String key,
int exp,
Object value,
long timeout,
long cas) |
<T> boolean |
cas(String key,
int exp,
T value,
Transcoder<T> transcoder,
long cas) |
<T> boolean |
cas(String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout,
long cas)
Cas is a check and set operation which means "store this data but only if no one else has
updated since I last fetched it."
|
<T> void |
casWithNoReply(String key,
CASOperation<T> operation) |
<T> void |
casWithNoReply(String key,
GetsResponse<T> getsResponse,
CASOperation<T> operation) |
<T> void |
casWithNoReply(String key,
int exp,
CASOperation<T> operation) |
<T> void |
casWithNoReply(String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation)
cas noreply
|
protected void |
checkException(Command command) |
protected void |
connect(InetSocketAddressWrapper inetSocketAddressWrapper) |
long |
decr(String key,
long delta)
"decr" are used to change data for some item in-place, decrementing it.
|
long |
decr(String key,
long delta,
long initValue) |
long |
decr(String key,
long delta,
long initValue,
long timeout)
"decr" are used to change data for some item in-place, decrementing it.
|
long |
decr(String key,
long delta,
long initValue,
long timeout,
int exp)
"incr" are used to change data for some item in-place, incrementing it.
|
void |
decrWithNoReply(String key,
long delta)
"decr" are used to change data for some item in-place, decrementing it.
|
boolean |
delete(String key) |
boolean |
delete(String key,
int time)
Delete key's data item from memcached.It it is not exists,return false.
time is the amount of time in seconds (or Unix time until
which) the client wishes the server to refuse "add" and "replace"
commands with this key.
|
boolean |
delete(String key,
long opTimeout)
Delete key's date item from memcached
|
boolean |
delete(String key,
long cas,
long opTimeout)
Delete key's date item from memcached only if its cas value is the same as what was read.
|
void |
deleteWithNoReply(String key) |
void |
deleteWithNoReply(String key,
int time)
Delete key's data item from memcached.This method doesn't wait for reply
|
void |
endWithNamespace()
Remove current namespace set for this memcached client.It must begin with
MemcachedClient.beginWithNamespace(String) method. |
void |
flushAll()
Make All connected memcached's data item invalid
|
void |
flushAll(InetSocketAddress address)
Invalidate all existing items immediately
|
void |
flushAll(InetSocketAddress address,
long timeout) |
void |
flushAll(InetSocketAddress address,
long timeout,
int exptime) |
void |
flushAll(int exptime,
long timeout) |
void |
flushAll(long timeout)
Make All connected memcached's data item invalid
|
void |
flushAll(String host)
This method is deprecated,please use flushAll(InetSocketAddress) instead.
|
void |
flushAllWithNoReply() |
void |
flushAllWithNoReply(InetSocketAddress address) |
void |
flushAllWithNoReply(InetSocketAddress address,
int exptime) |
void |
flushAllWithNoReply(int exptime) |
<T> Map<String,T> |
get(Collection<String> keyCollections) |
<T> Map<String,T> |
get(Collection<String> keyCollections,
long timeout) |
<T> Map<String,T> |
get(Collection<String> keyCollections,
long timeout,
Transcoder<T> transcoder)
Bulk get items
|
<T> Map<String,T> |
get(Collection<String> keyCollections,
Transcoder<T> transcoder) |
<T> T |
get(String key) |
<T> T |
get(String key,
long timeout) |
<T> T |
get(String key,
long timeout,
Transcoder<T> transcoder)
Get value by key
|
<T> T |
get(String key,
Transcoder<T> transcoder) |
<T> T |
getAndTouch(String key,
int newExp)
Get item and set a new expiration time for it,using default opTimeout
|
<T> T |
getAndTouch(String key,
int newExp,
long opTimeout)
Get item and set a new expiration time for it
|
Map<InetSocketAddress,AuthInfo> |
getAuthInfoMap()
return current all auth info
|
Map<String,AuthInfo> |
getAuthInfoStringMap()
Retruns the AuthInfo for all server strings (hostname:port)
|
Collection<InetSocketAddress> |
getAvailableServers()
Returns available memcached servers list.
|
Collection<InetSocketAddress> |
getAvaliableServers()
Deprecated.
|
CommandFactory |
getCommandFactory() |
int |
getConnectionSizeBySocketAddress(InetSocketAddress address) |
Connector |
getConnector()
return the session manager
|
long |
getConnectTimeout()
Get the connect timeout
|
Counter |
getCounter(String key)
Get counter for key,and if the key's value is not set,then set it with 0.
|
Counter |
getCounter(String key,
long initialValue)
Get counter for key,and if the key's value is not set,then set it with initial value.
|
long |
getHealSessionInterval()
Return the default heal session interval in milliseconds
|
KeyIterator |
getKeyIterator(InetSocketAddress address)
Deprecated.
memcached 1.6.x will remove cachedump stats command,so this method will be removed
in the future
|
KeyProvider |
getKeyProvider() |
String |
getName()
Return the cache instance name
|
String |
getNamespace(String ns)
Returns the real namespace of ns.
|
long |
getOpTimeout()
get operation timeout setting
|
Protocol |
getProtocol() |
Queue<ReconnectRequest> |
getReconnectRequestQueue()
Returns reconnecting task queue,the queue is thread-safe and 'weakly consistent',but maybe you
should not modify it at all.
|
<T> Map<String,GetsResponse<T>> |
gets(Collection<String> keyCollections) |
<T> Map<String,GetsResponse<T>> |
gets(Collection<String> keyCollections,
long timeout) |
<T> Map<String,GetsResponse<T>> |
gets(Collection<String> keyCollections,
long timeout,
Transcoder<T> transcoder)
Bulk gets items
|
<T> Map<String,GetsResponse<T>> |
gets(Collection<String> keyCollections,
Transcoder<T> transcoder) |
<T> GetsResponse<T> |
gets(String key) |
<T> GetsResponse<T> |
gets(String key,
long timeout) |
<T> GetsResponse<T> |
gets(String key,
long timeout,
Transcoder<T> transcoder)
Just like get,But it return a GetsResponse,include cas value for cas update.
|
<T> GetsResponse<T> |
gets(String key,
Transcoder transcoder) |
List<String> |
getServersDescription()
Get all connected memcached servers
|
MemcachedSessionComparator |
getSessionComparator() |
MemcachedSessionLocator |
getSessionLocator() |
Collection<MemcachedClientStateListener> |
getStateListeners()
Get all current state listeners
|
Map<InetSocketAddress,Map<String,String>> |
getStats() |
Map<InetSocketAddress,Map<String,String>> |
getStats(long timeout)
Get stats from all memcached servers
|
Map<InetSocketAddress,Map<String,String>> |
getStatsByItem(String itemName)
Get special item stats.
|
Map<InetSocketAddress,Map<String,String>> |
getStatsByItem(String itemName,
long timeout) |
int |
getTimeoutExceptionThreshold()
Returns maximum number of timeout exception for closing connection.
|
Transcoder |
getTranscoder()
return default transcoder,default is SerializingTranscoder
|
Map<InetSocketAddress,String> |
getVersions()
Get all connected memcached servers's version.
|
Map<InetSocketAddress,String> |
getVersions(long timeout) |
long |
incr(String key,
long delta)
"incr" are used to change data for some item in-place, incrementing it.
|
long |
incr(String key,
long delta,
long initValue) |
long |
incr(String key,
long delta,
long initValue,
long timeout)
"incr" are used to change data for some item in-place, incrementing it.
|
long |
incr(String key,
long delta,
long initValue,
long timeout,
int exp)
"incr" are used to change data for some item in-place, incrementing it.
|
void |
incrWithNoReply(String key,
long delta)
"incr" are used to change data for some item in-place, incrementing it.
|
void |
invalidateNamespace(String ns)
Invalidate all namespace under the namespace using the default operation timeout.
|
void |
invalidateNamespace(String ns,
long opTimeout)
Invalidate all items under the namespace.
|
boolean |
isFailureMode()
Returns if client is in failure mode.
|
boolean |
isSanitizeKeys() |
boolean |
isShutdown() |
protected void |
latchWait(Command cmd,
long timeout,
Session session) |
protected MemcachedConnector |
newConnector(BufferAllocator bufferAllocator,
Configuration configuration,
MemcachedSessionLocator memcachedSessionLocator,
MemcachedSessionComparator memcachedSessionComparator,
CommandFactory commandFactory,
int poolSize,
int maxQueuedNoReplyOperations) |
protected InetSocketAddress |
newSocketAddress(String server,
int port) |
boolean |
prepend(String key,
Object value) |
boolean |
prepend(String key,
Object value,
long timeout)
Prepend value to key's data item in memcached.This method doesn't wait for reply.
|
void |
prependWithNoReply(String key,
Object value)
Prepend value to key's data item in memcached.This method doesn't wait for reply.
|
void |
removeServer(InetSocketAddress address)
Remove memcached server with the exact given address.
|
void |
removeServer(String hostList)
Remove memcached servers
|
void |
removeStateListener(MemcachedClientStateListener listener)
Remove a memcached client listener
|
boolean |
replace(String key,
int exp,
Object value) |
boolean |
replace(String key,
int exp,
Object value,
long timeout) |
<T> boolean |
replace(String key,
int exp,
T value,
Transcoder<T> transcoder) |
<T> boolean |
replace(String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
Replace the key's data item in memcached,success only when the key's data item is exists in
memcached.This method will wait for reply from server.
|
void |
replaceWithNoReply(String key,
int exp,
Object value)
Replace the key's data item in memcached,success only when the key's data item is exists in
memcached.This method doesn't wait for reply from server.
|
<T> void |
replaceWithNoReply(String key,
int exp,
T value,
Transcoder<T> transcoder) |
protected Session |
sendCommand(Command cmd) |
boolean |
set(String key,
int exp,
Object value) |
boolean |
set(String key,
int exp,
Object value,
long timeout) |
<T> boolean |
set(String key,
int exp,
T value,
Transcoder<T> transcoder) |
<T> boolean |
set(String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
Store key-value item to memcached
|
void |
setAuthInfoMap(Map<InetSocketAddress,AuthInfo> map)
Configure auth info
|
void |
setBufferAllocator(BufferAllocator bufferAllocator)
Set the nio's ByteBuffer Allocator,use SimpleBufferAllocator by default.
|
void |
setConnectionPoolSize(int poolSize)
In a high concurrent enviroment,you may want to pool memcached clients.But a xmemcached client
has to start a reactor thread and some thread pools,if you create too many clients,the cost is
very large.
|
void |
setConnectTimeout(long connectTimeout)
Set the connect timeout,default is 1 minutes
|
void |
setEnableHealSession(boolean enableHealSession)
If the memcached dump or network error cause connection closed,xmemcached would try to heal the
connection.You can disable this behaviour by using this method:
client.setEnableHealSession(false); The default value is true. |
void |
setEnableHeartBeat(boolean enableHeartBeat)
Whether to enable heart beat
|
void |
setFailureMode(boolean failureMode)
Configure wheather to set client in failure mode.If set it to true,that means you want to
configure client in failure mode.
|
void |
setHealSessionInterval(long healConnectionInterval)
If the memcached dump or network error cause connection closed,xmemcached would try to heal the
connection.The interval between reconnections is 2 seconds by default.
|
void |
setKeyProvider(KeyProvider keyProvider)
Set a key provider for pre-processing keys before sending them to memcached.
|
void |
setLoggingLevelVerbosity(InetSocketAddress address,
int level)
Set the verbosity level of the memcached's logging output.This method will wait for reply.
|
void |
setLoggingLevelVerbosityWithNoReply(InetSocketAddress address,
int level)
Set the verbosity level of the memcached's logging output.This method doesn't wait for reply
from server
|
void |
setMergeFactor(int mergeFactor)
Set the merge factor,this factor determins how many 'get' commands would be merge to one
multi-get command.default is 150
|
void |
setName(String name)
Set cache instance name
|
void |
setOpTimeout(long opTimeout)
set operation timeout,default is one second.
|
void |
setOptimizeGet(boolean optimizeGet)
Enable/Disable merge many get commands to one multi-get command.true is to enable it,false is
to disable it.Default is true.Recommend users to enable it.
|
void |
setOptimizeMergeBuffer(boolean optimizeMergeBuffer)
Enable/Disable merge many command's buffers to one big buffer fit socket's send buffer
size.Default is true.Recommend true.
|
void |
setPrimitiveAsString(boolean primitiveAsString)
Store all primitive type as string,defualt is false.
|
void |
setSanitizeKeys(boolean sanitizeKeys)
Enables/disables sanitizing keys by URLEncoding.
|
void |
setServerWeight(String server,
int weight)
Set a memcached server's weight
|
void |
setTimeoutExceptionThreshold(int timeoutExceptionThreshold)
Set maximum number of timeout exception for closing connection.You can set it to be a large
value to disable this feature.
|
void |
setTranscoder(Transcoder transcoder)
set transcoder
|
void |
setWithNoReply(String key,
int exp,
Object value)
Store key-value item to memcached,doesn't wait for reply
|
<T> void |
setWithNoReply(String key,
int exp,
T value,
Transcoder<T> transcoder) |
void |
shutdown() |
protected void |
shutdown0()
For subclass override.
|
Map<String,String> |
stats(InetSocketAddress address) |
Map<String,String> |
stats(InetSocketAddress address,
long timeout)
�ョ��瑰������emcached server缁��淇℃�
|
boolean |
touch(String key,
int exp)
Set a new expiration time for an existing item,using default opTimeout second.
|
boolean |
touch(String key,
int exp,
long opTimeout)
Set a new expiration time for an existing item
|
<T> T |
withNamespace(String ns,
MemcachedClientCallable<T> callable)
With the namespae to do something with current memcached client.All operations with memcached
client done in callable will be under the namespace.
|
protected MemcachedSessionLocator sessionLocator
protected MemcachedSessionComparator sessionComparator
protected MemcachedConnector connector
protected CommandFactory commandFactory
protected long opTimeout
protected int connectionPoolSize
protected int maxQueuedNoReplyOperations
protected boolean resolveInetAddresses
protected final AtomicInteger serverOrderCount
public static final ThreadLocal<String> NAMESPACE_LOCAL
public XMemcachedClient(String server, int port) throws IOException
server
- �����Pport
- ����ㄧ���IOException
public XMemcachedClient(String host, int port, int weight) throws IOException
host
- server hostport
- server portweight
- server weightIOException
public XMemcachedClient(InetSocketAddress inetSocketAddress, int weight, CommandFactory cmdFactory) throws IOException
inetSocketAddress
- weight
- IOException
public XMemcachedClient(InetSocketAddress inetSocketAddress, int weight) throws IOException
IOException
public XMemcachedClient(InetSocketAddress inetSocketAddress) throws IOException
IOException
public XMemcachedClient() throws IOException
IOException
public XMemcachedClient(MemcachedSessionLocator locator, MemcachedSessionComparator comparator, BufferAllocator allocator, Configuration conf, Map<SocketOption,Object> socketOptions, CommandFactory commandFactory, Transcoder transcoder, Map<InetSocketAddress,InetSocketAddress> addressMap, List<MemcachedClientStateListener> stateListeners, Map<InetSocketAddress,AuthInfo> map, int poolSize, long connectTimeout, String name, boolean failureMode, boolean resolveInetAddresses) throws IOException
locator
- comparator
- allocator
- conf
- commandFactory
- transcoder
- addressList
- stateListeners
- IOException
public XMemcachedClient(List<InetSocketAddress> addressList) throws IOException
addressList
- IOException
public XMemcachedClient(List<InetSocketAddress> addressList, CommandFactory cmdFactory) throws IOException
cmdFactory
- command factoryaddressList
- memcached server socket address list.IOException
public final void setMergeFactor(int mergeFactor)
MemcachedClient
setMergeFactor
in interface MemcachedClient
public int getTimeoutExceptionThreshold()
MemcachedClient
getTimeoutExceptionThreshold
in interface MemcachedClient
public void setTimeoutExceptionThreshold(int timeoutExceptionThreshold)
MemcachedClient
setTimeoutExceptionThreshold
in interface MemcachedClient
MemcachedClient.DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD
public <T> T withNamespace(String ns, MemcachedClientCallable<T> callable) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
MemcachedClient.beginWithNamespace(String)
and
MemcachedClient.endWithNamespace()
will called around automatically. For example:
memcachedClient.withNamespace(userId,new MemcachedClientCallable{ public Void call(MemcachedClient client) throws MemcachedException, InterruptedException, TimeoutException{ client.set("username",0,username); client.set("email",0,email); return null; } }); //invalidate all items under the namespace. memcachedClient.invalidateNamespace(userId);
withNamespace
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
MemcachedClient.beginWithNamespace(String)
,
MemcachedClient.endWithNamespace()
public void endWithNamespace()
MemcachedClient
MemcachedClient.beginWithNamespace(String)
method.endWithNamespace
in interface MemcachedClient
MemcachedClient.beginWithNamespace(String)
public void beginWithNamespace(String ns)
MemcachedClient
MemcachedClient.endWithNamespace()
method.For example:
memcachedClient.beginWithNamespace(userId); try { memcachedClient.set("username", 0, username); memcachedClient.set("email", 0, email); } finally { memcachedClient.endWithNamespace(); }
beginWithNamespace
in interface MemcachedClient
MemcachedClient.endWithNamespace()
,
MemcachedClient.withNamespace(String, MemcachedClientCallable)
public KeyProvider getKeyProvider()
public void setKeyProvider(KeyProvider keyProvider)
MemcachedClient
setKeyProvider
in interface MemcachedClient
public final MemcachedSessionLocator getSessionLocator()
public final MemcachedSessionComparator getSessionComparator()
public final CommandFactory getCommandFactory()
public String getName()
XMemcachedClientMBean
getName
in interface MemcachedClient
getName
in interface XMemcachedClientMBean
public void setName(String name)
MemcachedClient
setName
in interface MemcachedClient
public long getConnectTimeout()
MemcachedClient
getConnectTimeout
in interface MemcachedClient
public void setConnectTimeout(long connectTimeout)
MemcachedClient
setConnectTimeout
in interface MemcachedClient
public void setEnableHeartBeat(boolean enableHeartBeat)
MemcachedClient
setEnableHeartBeat
in interface MemcachedClient
enableHeartBeat
- if true,then enable heartbeat,true by defaultpublic final long getOpTimeout()
getOpTimeout
in interface MemcachedClient
public final void setOpTimeout(long opTimeout)
setOpTimeout
in interface MemcachedClient
opTimeout
- public void setHealSessionInterval(long healConnectionInterval)
MemcachedClient
setHealSessionInterval
in interface MemcachedClient
healConnectionInterval
- MILLISECONDSpublic long getHealSessionInterval()
MemcachedClient
getHealSessionInterval
in interface MemcachedClient
public Map<InetSocketAddress,AuthInfo> getAuthInfoMap()
MemcachedClient
getAuthInfoMap
in interface MemcachedClient
public void setAuthInfoMap(Map<InetSocketAddress,AuthInfo> map)
MemcachedClient
setAuthInfoMap
in interface MemcachedClient
map
- Auth info map,key is memcached server address,and value is the auth info for the
key.public Map<String,AuthInfo> getAuthInfoStringMap()
MemcachedClient
getAuthInfoStringMap
in interface MemcachedClient
public final Connector getConnector()
MemcachedClient
getConnector
in interface MemcachedClient
public final void setOptimizeMergeBuffer(boolean optimizeMergeBuffer)
MemcachedClient
setOptimizeMergeBuffer
in interface MemcachedClient
public final boolean isShutdown()
isShutdown
in interface MemcachedClient
protected final Session sendCommand(Command cmd) throws MemcachedException
MemcachedException
protected InetSocketAddress newSocketAddress(String server, int port)
public final void addServer(String server, int port) throws IOException
MemcachedClient
addServer
in interface MemcachedClient
server
- host stringport
- port numberIOException
public final void addServer(String server, int port, int weight) throws IOException
addServer
in interface MemcachedClient
server
- port
- weight
- IOException
public final void addServer(InetSocketAddress inetSocketAddress) throws IOException
MemcachedClient
addServer
in interface MemcachedClient
inetSocketAddress
- memcached server's socket addressIOException
public final void addServer(InetSocketAddress inetSocketAddress, int weight) throws IOException
addServer
in interface MemcachedClient
IOException
public final void addServer(String hostList) throws IOException
XMemcachedClientMBean
addServer
in interface MemcachedClient
addServer
in interface XMemcachedClientMBean
IOException
public void addOneServerWithWeight(String server, int weight) throws IOException
XMemcachedClientMBean
addOneServerWithWeight
in interface XMemcachedClientMBean
server
- a String in the form of "[host1]:[port1],[host2]:[port2]"weight
- server's weightIOException
public final List<String> getServersDescription()
XMemcachedClientMBean
getServersDescription
in interface MemcachedClient
getServersDescription
in interface XMemcachedClientMBean
public final void setServerWeight(String server, int weight)
XMemcachedClientMBean
setServerWeight
in interface XMemcachedClientMBean
public final void removeServer(String hostList)
XMemcachedClientMBean
removeServer
in interface MemcachedClient
removeServer
in interface XMemcachedClientMBean
public void removeServer(InetSocketAddress address)
MemcachedClient
removeServer
in interface MemcachedClient
address
- Resolved server addressprotected void connect(InetSocketAddressWrapper inetSocketAddressWrapper) throws IOException
IOException
protected MemcachedConnector newConnector(BufferAllocator bufferAllocator, Configuration configuration, MemcachedSessionLocator memcachedSessionLocator, MemcachedSessionComparator memcachedSessionComparator, CommandFactory commandFactory, int poolSize, int maxQueuedNoReplyOperations)
public void setOptimizeGet(boolean optimizeGet)
MemcachedClient
setOptimizeGet
in interface MemcachedClient
public final void setBufferAllocator(BufferAllocator bufferAllocator)
MemcachedClient
setBufferAllocator
in interface MemcachedClient
public final <T> T get(String key, long timeout, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
get
in interface MemcachedClient
key
- Keytimeout
- Operation timeout,if the method is not returned in this time,throw
TimeoutExceptiontranscoder
- The value's transcoderTimeoutException
InterruptedException
MemcachedException
public final <T> T get(String key, long timeout) throws TimeoutException, InterruptedException, MemcachedException
get
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final <T> T get(String key, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
get
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final <T> T get(String key) throws TimeoutException, InterruptedException, MemcachedException
get
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final <T> GetsResponse<T> gets(String key, long timeout, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
gets
in interface MemcachedClient
key
- keytimeout
- operation timeoutTimeoutException
InterruptedException
MemcachedException
public final <T> GetsResponse<T> gets(String key) throws TimeoutException, InterruptedException, MemcachedException
gets
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.gets(String, long, Transcoder)
public final <T> GetsResponse<T> gets(String key, long timeout) throws TimeoutException, InterruptedException, MemcachedException
gets
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.gets(String, long, Transcoder)
public final <T> GetsResponse<T> gets(String key, Transcoder transcoder) throws TimeoutException, InterruptedException, MemcachedException
gets
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.gets(String, long, Transcoder)
public final <T> Map<String,T> get(Collection<String> keyCollections, long timeout, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
get
in interface MemcachedClient
keyCollections
- key collectiontimeout
- opTimeouttranscoder
- Value transcoderTimeoutException
InterruptedException
MemcachedException
public final <T> Map<String,T> get(Collection<String> keyCollections, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
get
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.get(Collection, long, Transcoder)
public final <T> Map<String,T> get(Collection<String> keyCollections) throws TimeoutException, InterruptedException, MemcachedException
get
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.get(Collection, long, Transcoder)
public final <T> Map<String,T> get(Collection<String> keyCollections, long timeout) throws TimeoutException, InterruptedException, MemcachedException
get
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.get(Collection, long, Transcoder)
public final <T> Map<String,GetsResponse<T>> gets(Collection<String> keyCollections, long timeout, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
gets
in interface MemcachedClient
keyCollections
- key collectiontimeout
- Operation timeouttranscoder
- Value transcoderTimeoutException
InterruptedException
MemcachedException
GetsResponse
public final <T> Map<String,GetsResponse<T>> gets(Collection<String> keyCollections) throws TimeoutException, InterruptedException, MemcachedException
gets
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.gets(Collection, long, Transcoder)
public final <T> Map<String,GetsResponse<T>> gets(Collection<String> keyCollections, long timeout) throws TimeoutException, InterruptedException, MemcachedException
gets
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.gets(Collection, long, Transcoder)
public final <T> Map<String,GetsResponse<T>> gets(Collection<String> keyCollections, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
gets
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.gets(Collection, long, Transcoder)
public final <T> boolean set(String key, int exp, T value, Transcoder<T> transcoder, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
set
in interface MemcachedClient
key
- stored keyexp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.value
- stored datatranscoder
- transocdertimeout
- operation timeout,in millisecondsTimeoutException
InterruptedException
MemcachedException
public void setWithNoReply(String key, int exp, Object value) throws InterruptedException, MemcachedException
MemcachedClient
setWithNoReply
in interface MemcachedClient
key
- stored keyexp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.value
- stored dataInterruptedException
MemcachedException
public <T> void setWithNoReply(String key, int exp, T value, Transcoder<T> transcoder) throws InterruptedException, MemcachedException
setWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
MemcachedClient.setWithNoReply(String, int, Object, Transcoder)
public final boolean set(String key, int exp, Object value) throws TimeoutException, InterruptedException, MemcachedException
set
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.set(String, int, Object, Transcoder, long)
public final boolean set(String key, int exp, Object value, long timeout) throws TimeoutException, InterruptedException, MemcachedException
set
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.set(String, int, Object, Transcoder, long)
public final <T> boolean set(String key, int exp, T value, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
set
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.set(String, int, Object, Transcoder, long)
public final <T> boolean add(String key, int exp, T value, Transcoder<T> transcoder, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
add
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.TimeoutException
InterruptedException
MemcachedException
public final boolean add(String key, int exp, Object value) throws TimeoutException, InterruptedException, MemcachedException
add
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.add(String, int, Object, Transcoder, long)
public final boolean add(String key, int exp, Object value, long timeout) throws TimeoutException, InterruptedException, MemcachedException
add
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.add(String, int, Object, Transcoder, long)
public final <T> boolean add(String key, int exp, T value, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
add
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.add(String, int, Object, Transcoder, long)
public void addWithNoReply(String key, int exp, Object value) throws InterruptedException, MemcachedException
MemcachedClient
addWithNoReply
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.InterruptedException
MemcachedException
public <T> void addWithNoReply(String key, int exp, T value, Transcoder<T> transcoder) throws InterruptedException, MemcachedException
addWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
MemcachedClient.addWithNoReply(String, int, Object, Transcoder)
public void replaceWithNoReply(String key, int exp, Object value) throws InterruptedException, MemcachedException
MemcachedClient
replaceWithNoReply
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.InterruptedException
MemcachedException
public <T> void replaceWithNoReply(String key, int exp, T value, Transcoder<T> transcoder) throws InterruptedException, MemcachedException
replaceWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
MemcachedClient.replaceWithNoReply(String, int, Object, Transcoder)
public final <T> boolean replace(String key, int exp, T value, Transcoder<T> transcoder, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
replace
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.TimeoutException
InterruptedException
MemcachedException
public final boolean replace(String key, int exp, Object value) throws TimeoutException, InterruptedException, MemcachedException
replace
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.replace(String, int, Object, Transcoder, long)
public final boolean replace(String key, int exp, Object value, long timeout) throws TimeoutException, InterruptedException, MemcachedException
replace
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.replace(String, int, Object, Transcoder, long)
public final <T> boolean replace(String key, int exp, T value, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
replace
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.replace(String, int, Object, Transcoder, long)
public final boolean append(String key, Object value) throws TimeoutException, InterruptedException, MemcachedException
append
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.append(String, Object, long)
public final boolean append(String key, Object value, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
append
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public void appendWithNoReply(String key, Object value) throws InterruptedException, MemcachedException
MemcachedClient
appendWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
public final boolean prepend(String key, Object value) throws TimeoutException, InterruptedException, MemcachedException
prepend
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.prepend(String, Object, long)
public final boolean prepend(String key, Object value, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
prepend
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public void prependWithNoReply(String key, Object value) throws InterruptedException, MemcachedException
MemcachedClient
prependWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
public final boolean cas(String key, int exp, Object value, long cas) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, Object, Transcoder, long, long)
public final <T> boolean cas(String key, int exp, T value, Transcoder<T> transcoder, long timeout, long cas) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
cas
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.TimeoutException
InterruptedException
MemcachedException
public final boolean cas(String key, int exp, Object value, long timeout, long cas) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, Object, Transcoder, long, long)
public final <T> boolean cas(String key, int exp, T value, Transcoder<T> transcoder, long cas) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, Object, Transcoder, long, long)
public final <T> boolean cas(String key, int exp, CASOperation<T> operation, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
cas
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.operation
- CASOperationtranscoder
- object transcoderTimeoutException
InterruptedException
MemcachedException
public final <T> boolean cas(String key, int exp, GetsResponse<T> getsReponse, CASOperation<T> operation, Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
cas
in interface MemcachedClient
exp
- An expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as a
unix timestamp of an exact date.getsReponse
- gets method's resultoperation
- CASOperationTimeoutException
InterruptedException
MemcachedException
public final <T> boolean cas(String key, int exp, GetsResponse<T> getsReponse, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, GetsResponse, CASOperation, Transcoder)
public <T> void casWithNoReply(String key, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
casWithNoReply
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.casWithNoReply(String, int, GetsResponse, CASOperation)
public <T> void casWithNoReply(String key, GetsResponse<T> getsResponse, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
casWithNoReply
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public <T> void casWithNoReply(String key, int exp, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
casWithNoReply
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.casWithNoReply(String, int, GetsResponse, CASOperation)
public <T> void casWithNoReply(String key, int exp, GetsResponse<T> getsReponse, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
casWithNoReply
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final <T> boolean cas(String key, GetsResponse<T> getsReponse, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, GetsResponse, CASOperation, Transcoder)
public final <T> boolean cas(String key, int exp, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, GetsResponse, CASOperation, Transcoder)
public final <T> boolean cas(String key, CASOperation<T> operation) throws TimeoutException, InterruptedException, MemcachedException
cas
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
MemcachedClient.cas(String, int, GetsResponse, CASOperation, Transcoder)
public final boolean delete(String key, int time) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
delete
in interface MemcachedClient
InterruptedException
MemcachedException
TimeoutException
public boolean delete(String key, long opTimeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
delete
in interface MemcachedClient
opTimeout
- Operation timeoutTimeoutException
InterruptedException
MemcachedException
public boolean delete(String key, long cas, long opTimeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
delete
in interface MemcachedClient
opTimeout
- Operation timeoutTimeoutException
InterruptedException
MemcachedException
public final void deleteWithNoReply(String key, int time) throws InterruptedException, MemcachedException
deleteWithNoReply
in interface MemcachedClient
key
- time
- InterruptedException
MemcachedException
public final void deleteWithNoReply(String key) throws InterruptedException, MemcachedException
deleteWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
protected void checkException(Command command) throws MemcachedException
MemcachedException
public boolean touch(String key, int exp, long opTimeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
touch
in interface MemcachedClient
key
- item's keyexp
- New expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as
a unix timestamp of an exact date.opTimeout
- operation timeoutTimeoutException
InterruptedException
MemcachedException
public boolean touch(String key, int exp) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
touch
in interface MemcachedClient
key
- item's keyexp
- New expiration time, in seconds. Can be up to 30 days. After 30 days, is treated as
a unix timestamp of an exact date.TimeoutException
InterruptedException
MemcachedException
public <T> T getAndTouch(String key, int newExp, long opTimeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
getAndTouch
in interface MemcachedClient
key
- item's keynewExp
- New expiration time, in seconds. Can be up to 30 days. After 30 days, is treated
as a unix timestamp of an exact date.opTimeout
- operation timeoutTimeoutException
InterruptedException
MemcachedException
public <T> T getAndTouch(String key, int newExp) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
getAndTouch
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final long incr(String key, long delta) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
incr
in interface MemcachedClient
InterruptedException
MemcachedException
TimeoutException
public long incr(String key, long delta, long initValue) throws TimeoutException, InterruptedException, MemcachedException
incr
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public long incr(String key, long delta, long initValue, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
incr
in interface MemcachedClient
key
- keyinitValue
- initValue if the data is not exists.timeout
- operation timeoutTimeoutException
InterruptedException
MemcachedException
public long incr(String key, long delta, long initValue, long timeout, int exp) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
incr
in interface MemcachedClient
key
- keydelta
- increment deltainitValue
- the initial value to be added when value is not foundtimeout
- operation timeoutexp
- the initial vlaue expire time, in seconds. Can be up to 30 days. After 30 days, is
treated as a unix timestamp of an exact date.TimeoutException
InterruptedException
MemcachedException
public final void incrWithNoReply(String key, long delta) throws InterruptedException, MemcachedException
MemcachedClient
incrWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
public final void decrWithNoReply(String key, long delta) throws InterruptedException, MemcachedException
MemcachedClient
decrWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
public final long decr(String key, long delta) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
decr
in interface MemcachedClient
InterruptedException
MemcachedException
TimeoutException
public long decr(String key, long delta, long initValue) throws TimeoutException, InterruptedException, MemcachedException
decr
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
decr
public long decr(String key, long delta, long initValue, long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
decr
in interface MemcachedClient
key
- The keyinitValue
- The initial value if the data is not exists.timeout
- Operation timeoutTimeoutException
InterruptedException
MemcachedException
public long decr(String key, long delta, long initValue, long timeout, int exp) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
decr
in interface MemcachedClient
initValue
- the initial value to be added when value is not foundexp
- the initial vlaue expire time, in seconds. Can be up to 30 days. After 30 days, is
treated as a unix timestamp of an exact date.TimeoutException
InterruptedException
MemcachedException
public final void flushAll() throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
flushAll
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public void flushAllWithNoReply() throws InterruptedException, MemcachedException
flushAllWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
public void flushAllWithNoReply(int exptime) throws InterruptedException, MemcachedException
flushAllWithNoReply
in interface MemcachedClient
InterruptedException
MemcachedException
public void flushAllWithNoReply(InetSocketAddress address) throws MemcachedException, InterruptedException
flushAllWithNoReply
in interface MemcachedClient
MemcachedException
InterruptedException
public void flushAllWithNoReply(InetSocketAddress address, int exptime) throws MemcachedException, InterruptedException
flushAllWithNoReply
in interface MemcachedClient
MemcachedException
InterruptedException
public final void flushAll(int exptime, long timeout) throws TimeoutException, InterruptedException, MemcachedException
flushAll
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final void flushAll(long timeout) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
flushAll
in interface MemcachedClient
timeout
- operation timeoutTimeoutException
InterruptedException
MemcachedException
public void setLoggingLevelVerbosity(InetSocketAddress address, int level) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
setLoggingLevelVerbosity
in interface MemcachedClient
level
- logging levelTimeoutException
InterruptedException
MemcachedException
public void setLoggingLevelVerbosityWithNoReply(InetSocketAddress address, int level) throws InterruptedException, MemcachedException
MemcachedClient
setLoggingLevelVerbosityWithNoReply
in interface MemcachedClient
address
- memcached server addresslevel
- logging levelInterruptedException
MemcachedException
public final void flushAll(InetSocketAddress address) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
flushAll
in interface MemcachedClient
address
- Target memcached serverMemcachedException
InterruptedException
TimeoutException
public final void flushAll(InetSocketAddress address, long timeout) throws MemcachedException, InterruptedException, TimeoutException
flushAll
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
public final void flushAll(InetSocketAddress address, long timeout, int exptime) throws MemcachedException, InterruptedException, TimeoutException
flushAll
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
public final void flushAll(String host) throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
flushAll
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final Map<String,String> stats(InetSocketAddress address) throws MemcachedException, InterruptedException, TimeoutException
stats
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
public final Map<String,String> stats(InetSocketAddress address, long timeout) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
stats
in interface MemcachedClient
address
- ����板�timeout
- ���瓒��MemcachedException
InterruptedException
TimeoutException
public final Map<InetSocketAddress,Map<String,String>> getStats() throws MemcachedException, InterruptedException, TimeoutException
getStats
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
public final Map<InetSocketAddress,Map<String,String>> getStatsByItem(String itemName) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
getStatsByItem
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
public final Map<InetSocketAddress,Map<String,String>> getStatsByItem(String itemName, long timeout) throws MemcachedException, InterruptedException, TimeoutException
getStatsByItem
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
public final Map<InetSocketAddress,String> getVersions() throws TimeoutException, InterruptedException, MemcachedException
MemcachedClient
getVersions
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final Map<InetSocketAddress,String> getVersions(long timeout) throws TimeoutException, InterruptedException, MemcachedException
getVersions
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public Map<InetSocketAddress,Map<String,String>> getStats(long timeout) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
getStats
in interface MemcachedClient
MemcachedException
InterruptedException
TimeoutException
protected void shutdown0()
public final void shutdown() throws IOException
shutdown
in interface MemcachedClient
IOException
public void setConnectionPoolSize(int poolSize)
MemcachedClient
setConnectionPoolSize
in interface MemcachedClient
poolSize
- pool size,default is one,every memcached has only one connection.public final boolean delete(String key) throws TimeoutException, InterruptedException, MemcachedException
delete
in interface MemcachedClient
TimeoutException
InterruptedException
MemcachedException
public final Transcoder getTranscoder()
MemcachedClient
getTranscoder
in interface MemcachedClient
public final void setTranscoder(Transcoder transcoder)
MemcachedClient
setTranscoder
in interface MemcachedClient
protected void latchWait(Command cmd, long timeout, Session session) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
@Deprecated public final Collection<InetSocketAddress> getAvaliableServers()
getAvaliableServers
in interface MemcachedClient
MemcachedClient.getAvailableServers()
public Collection<InetSocketAddress> getAvailableServers()
MemcachedClient
getAvailableServers
in interface MemcachedClient
public final int getConnectionSizeBySocketAddress(InetSocketAddress address)
public void addStateListener(MemcachedClientStateListener listener)
MemcachedClient
addStateListener
in interface MemcachedClient
public Collection<MemcachedClientStateListener> getStateListeners()
MemcachedClient
getStateListeners
in interface MemcachedClient
public void setPrimitiveAsString(boolean primitiveAsString)
MemcachedClient
setPrimitiveAsString
in interface MemcachedClient
public void removeStateListener(MemcachedClientStateListener listener)
MemcachedClient
removeStateListener
in interface MemcachedClient
public Protocol getProtocol()
getProtocol
in interface MemcachedClient
public boolean isSanitizeKeys()
isSanitizeKeys
in interface MemcachedClient
public void setSanitizeKeys(boolean sanitizeKeys)
MemcachedClient
setSanitizeKeys
in interface MemcachedClient
sanitizeKeys
- if true, then URLEncode all keyspublic void invalidateNamespace(String ns, long opTimeout) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
invalidateNamespace
in interface MemcachedClient
ns
- the namespaceopTimeout
- operation timeout in milliseconds.MemcachedException
InterruptedException
TimeoutException
public void invalidateNamespace(String ns) throws MemcachedException, InterruptedException, TimeoutException
MemcachedClient
invalidateNamespace
in interface MemcachedClient
ns
- the namespaceMemcachedException
InterruptedException
TimeoutException
public String getNamespace(String ns) throws TimeoutException, InterruptedException, MemcachedException
ns
- TimeoutException
InterruptedException
MemcachedException
public Counter getCounter(String key, long initialValue)
MemcachedClient
getCounter
in interface MemcachedClient
public Counter getCounter(String key)
MemcachedClient
getCounter
in interface MemcachedClient
@Deprecated public KeyIterator getKeyIterator(InetSocketAddress address) throws MemcachedException, TimeoutException, InterruptedException
MemcachedClient
getKeyIterator
in interface MemcachedClient
MemcachedException
TimeoutException
InterruptedException
public void setEnableHealSession(boolean enableHealSession)
MemcachedClient
client.setEnableHealSession(false);
setEnableHealSession
in interface MemcachedClient
public void setFailureMode(boolean failureMode)
MemcachedClient
setFailureMode
in interface MemcachedClient
failureMode
- true is to configure client in failure mode.public boolean isFailureMode()
MemcachedClient
isFailureMode
in interface MemcachedClient
public Queue<ReconnectRequest> getReconnectRequestQueue()
MemcachedClient
getReconnectRequestQueue
in interface MemcachedClient
Copyright © 2021. All rights reserved.