|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MemcachedClient
The memcached client's interface
| Field Summary | |
|---|---|
static int |
DEFAULT_CONNECT_TIMEOUT
Default connect timeout,1 minutes |
static int |
DEFAULT_CONNECTION_POOL_SIZE
With java nio,there is only one connection to a memcached.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. |
static long |
DEFAULT_OP_TIMEOUT
Default operation timeout,if the operation is not returned in 1 second,throw TimeoutException |
static int |
DEFAULT_READ_THREAD_COUNT
Default thread number for reading nio's receive buffer and dispatch commands.Recommend users to set it equal or less to the memcached server's number on linux platform,keep default on windows.Default is 0. |
static int |
DEFAULT_SESSION_IDLE_TIMEOUT
Default session idle timeout,if session is idle,xmemcached will do a heartbeat action to check if connection is alive. |
static int |
DEFAULT_SESSION_READ_BUFF_SIZE
Default session read buffer size,16k |
static boolean |
DEFAULT_TCP_KEEPLIVE
Default TCP keeplive option,which is true |
static boolean |
DEFAULT_TCP_NO_DELAY
Disable Nagle algorithm by default |
static int |
DEFAULT_TCP_RECV_BUFF_SIZE
Default socket's receive buffer size,16k |
static int |
DEFAULT_TCP_SEND_BUFF_SIZE
Default socket's send buffer size,8k |
| Method Summary | ||
|---|---|---|
boolean |
add(java.lang.String key,
int exp,
java.lang.Object value)
|
|
boolean |
add(java.lang.String key,
int exp,
java.lang.Object value,
long timeout)
|
|
|
add(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
|
|
|
add(java.lang.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 |
addServer(java.net.InetSocketAddress inetSocketAddress)
Add a memcached server,the thread call this method will be blocked until the connecting operations completed(success or fail) |
|
void |
addServer(java.net.InetSocketAddress inetSocketAddress,
int weight)
|
|
void |
addServer(java.lang.String hostList)
Add many memcached servers.You can call this method through JMX or program |
|
void |
addServer(java.lang.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(java.lang.String server,
int port,
int weight)
add a memcached server to MemcachedClient |
|
void |
addStateListener(MemcachedClientStateListener listener)
Add a memcached client listener |
|
void |
addWithNoReply(java.lang.String key,
int exp,
java.lang.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. |
|
|
addWithNoReply(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
|
|
boolean |
append(java.lang.String key,
java.lang.Object value)
|
|
boolean |
append(java.lang.String key,
java.lang.Object value,
long timeout)
Append value to key's data item,this method will wait for reply |
|
void |
appendWithNoReply(java.lang.String key,
java.lang.Object value)
Append value to key's data item,this method doesn't wait for reply. |
|
|
cas(java.lang.String key,
CASOperation<T> operation)
|
|
|
cas(java.lang.String key,
GetsResponse<T> getsResponse,
CASOperation<T> operation)
|
|
|
cas(java.lang.String key,
int exp,
CASOperation<T> operation)
|
|
|
cas(java.lang.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." |
|
|
cas(java.lang.String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation)
|
|
|
cas(java.lang.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(java.lang.String key,
int exp,
java.lang.Object value,
long cas)
|
|
boolean |
cas(java.lang.String key,
int exp,
java.lang.Object value,
long timeout,
long cas)
|
|
|
cas(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long cas)
|
|
|
cas(java.lang.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." |
|
|
casWithNoReply(java.lang.String key,
CASOperation<T> operation)
|
|
|
casWithNoReply(java.lang.String key,
GetsResponse<T> getsResponse,
CASOperation<T> operation)
|
|
|
casWithNoReply(java.lang.String key,
int exp,
CASOperation<T> operation)
|
|
|
casWithNoReply(java.lang.String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation)
|
|
long |
decr(java.lang.String key,
long delta)
"decr" are used to change data for some item in-place, decrementing it. |
|
long |
decr(java.lang.String key,
long delta,
long initValue)
|
|
long |
decr(java.lang.String key,
long delta,
long initValue,
long timeout)
"decr" are used to change data for some item in-place, decrementing it. |
|
long |
decr(java.lang.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(java.lang.String key,
long delta)
"decr" are used to change data for some item in-place, decrementing it. |
|
boolean |
delete(java.lang.String key)
|
|
boolean |
delete(java.lang.String key,
int time)
Deprecated. |
|
void |
deleteWithNoReply(java.lang.String key)
|
|
void |
deleteWithNoReply(java.lang.String key,
int time)
Deprecated. |
|
void |
flushAll()
Make All connected memcached's data item invalid |
|
void |
flushAll(java.net.InetSocketAddress address)
Invalidate all existing items immediately |
|
void |
flushAll(java.net.InetSocketAddress address,
long timeout)
|
|
void |
flushAll(java.net.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(java.lang.String host)
Deprecated. |
|
void |
flushAllWithNoReply()
|
|
void |
flushAllWithNoReply(java.net.InetSocketAddress address)
|
|
void |
flushAllWithNoReply(java.net.InetSocketAddress address,
int exptime)
|
|
void |
flushAllWithNoReply(int exptime)
|
|
|
get(java.util.Collection<java.lang.String> keyCollections)
|
|
|
get(java.util.Collection<java.lang.String> keyCollections,
long timeout)
|
|
|
get(java.util.Collection<java.lang.String> keyCollections,
long timeout,
Transcoder<T> transcoder)
memcached的getMulti操作,批量获取一批key对应的数据项 |
|
|
get(java.util.Collection<java.lang.String> keyCollections,
Transcoder<T> transcoder)
|
|
|
get(java.lang.String key)
|
|
|
get(java.lang.String key,
long timeout)
|
|
|
get(java.lang.String key,
long timeout,
Transcoder<T> transcoder)
Get value by key |
|
|
get(java.lang.String key,
Transcoder<T> transcoder)
|
|
java.util.Map<java.net.InetSocketAddress,AuthInfo> |
getAuthInfoMap()
return current all auth info |
|
java.util.Collection<java.net.InetSocketAddress> |
getAvaliableServers()
get avaliable memcached servers's socket address. |
|
Connector |
getConnector()
return the session manager |
|
long |
getConnectTimeout()
Get the connect timeout |
|
Counter |
getCounter(java.lang.String key)
Get counter for key,and if the key's value is not set,then set it with 0. |
|
Counter |
getCounter(java.lang.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(java.net.InetSocketAddress address)
Get key iterator for special memcached server.You must known that the iterator is a snapshot for memcached all keys,it is not real-time. |
|
java.lang.String |
getName()
Return the cache instance name |
|
long |
getOpTimeout()
get operation timeout setting |
|
Protocol |
getProtocol()
|
|
java.util.Queue<ReconnectRequest> |
getReconnectRequestQueue()
Returns reconnecting task queue,the result is thread-safe,but maybe you should not modify it at all |
|
|
gets(java.util.Collection<java.lang.String> keyCollections)
|
|
|
gets(java.util.Collection<java.lang.String> keyCollections,
long timeout)
|
|
|
gets(java.util.Collection<java.lang.String> keyCollections,
long timeout,
Transcoder<T> transcoder)
类似getMulti,但是返回数据项的cas值,返回的map中value存储的是GetsResponse对象 |
|
|
gets(java.util.Collection<java.lang.String> keyCollections,
Transcoder<T> transcoder)
|
|
|
gets(java.lang.String key)
|
|
|
gets(java.lang.String key,
long timeout)
|
|
|
gets(java.lang.String key,
long timeout,
Transcoder<T> transcoder)
Just like get,But it return a GetsResponse,include cas value for cas update. |
|
|
gets(java.lang.String key,
Transcoder transcoder)
|
|
java.util.List<java.lang.String> |
getServersDescription()
Get current server list.You can call this method through JMX or program |
|
java.util.Collection<MemcachedClientStateListener> |
getStateListeners()
Get all current state listeners |
|
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> |
getStats()
|
|
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> |
getStats(long timeout)
Get stats from all memcached servers |
|
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> |
getStatsByItem(java.lang.String itemName)
Get special item stats. |
|
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> |
getStatsByItem(java.lang.String itemName,
long timeout)
|
|
Transcoder |
getTranscoder()
return default transcoder,default is SerializingTranscoder |
|
java.util.Map<java.net.InetSocketAddress,java.lang.String> |
getVersions()
Get all connected memcached servers's versions. |
|
java.util.Map<java.net.InetSocketAddress,java.lang.String> |
getVersions(long timeout)
|
|
long |
incr(java.lang.String key,
long delta)
"incr" are used to change data for some item in-place, incrementing it. |
|
long |
incr(java.lang.String key,
long delta,
long initValue)
|
|
long |
incr(java.lang.String key,
long delta,
long initValue,
long timeout)
"incr" are used to change data for some item in-place, incrementing it. |
|
long |
incr(java.lang.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(java.lang.String key,
long delta)
"incr" are used to change data for some item in-place, incrementing it. |
|
boolean |
isFailureMode()
Returns if client is in failure mode. |
|
boolean |
isSanitizeKeys()
|
|
boolean |
isShutdown()
|
|
boolean |
prepend(java.lang.String key,
java.lang.Object value)
|
|
boolean |
prepend(java.lang.String key,
java.lang.Object value,
long timeout)
Prepend value to key's data item in memcached.This method doesn't wait for reply. |
|
void |
prependWithNoReply(java.lang.String key,
java.lang.Object value)
Prepend value to key's data item in memcached.This method doesn't wait for reply. |
|
void |
removeServer(java.lang.String hostList)
Remove many memcached server |
|
void |
removeStateListener(MemcachedClientStateListener listener)
Remove a memcached client listener |
|
boolean |
replace(java.lang.String key,
int exp,
java.lang.Object value)
|
|
boolean |
replace(java.lang.String key,
int exp,
java.lang.Object value,
long timeout)
|
|
|
replace(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
|
|
|
replace(java.lang.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(java.lang.String key,
int exp,
java.lang.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. |
|
|
replaceWithNoReply(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
|
|
boolean |
set(java.lang.String key,
int exp,
java.lang.Object value)
|
|
boolean |
set(java.lang.String key,
int exp,
java.lang.Object value,
long timeout)
|
|
|
set(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
|
|
|
set(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
Store key-value item to memcached |
|
void |
setAuthInfoMap(java.util.Map<java.net.InetSocketAddress,AuthInfo> map)
Configure auth info |
|
void |
setBufferAllocator(BufferAllocator bufferAllocator)
Deprecated. |
|
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 |
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 |
setLoggingLevelVerbosity(java.net.InetSocketAddress address,
int level)
Set the verbosity level of the memcached's logging output.This method will wait for reply. |
|
void |
setLoggingLevelVerbosityWithNoReply(java.net.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(java.lang.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 sanitizeKey)
Enables/disables sanitizing keys by URLEncoding. |
|
void |
setTranscoder(Transcoder transcoder)
set transcoder |
|
void |
setWithNoReply(java.lang.String key,
int exp,
java.lang.Object value)
Store key-value item to memcached,doesn't wait for reply |
|
|
setWithNoReply(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
|
|
void |
shutdown()
|
|
java.util.Map<java.lang.String,java.lang.String> |
stats(java.net.InetSocketAddress address)
|
|
java.util.Map<java.lang.String,java.lang.String> |
stats(java.net.InetSocketAddress address,
long timeout)
查看特定节点的memcached server统计信息 |
|
| Field Detail |
|---|
static final int DEFAULT_READ_THREAD_COUNT
static final boolean DEFAULT_TCP_KEEPLIVE
static final int DEFAULT_CONNECT_TIMEOUT
static final int DEFAULT_TCP_SEND_BUFF_SIZE
static final boolean DEFAULT_TCP_NO_DELAY
static final int DEFAULT_SESSION_READ_BUFF_SIZE
static final int DEFAULT_TCP_RECV_BUFF_SIZE
static final long DEFAULT_OP_TIMEOUT
static final int DEFAULT_CONNECTION_POOL_SIZE
static final int DEFAULT_SESSION_IDLE_TIMEOUT
| Method Detail |
|---|
void setMergeFactor(int mergeFactor)
mergeFactor - long getConnectTimeout()
connectTimeout - void setConnectTimeout(long connectTimeout)
connectTimeout - Connector getConnector()
void setOptimizeGet(boolean optimizeGet)
optimizeGet - void setOptimizeMergeBuffer(boolean optimizeMergeBuffer)
optimizeMergeBuffer - boolean isShutdown()
void addServer(java.lang.String server,
int port)
throws java.io.IOException
server - host stringport - port number
java.io.IOException
void addServer(java.net.InetSocketAddress inetSocketAddress)
throws java.io.IOException
inetSocketAddress - memcached server's socket address
java.io.IOException
void addServer(java.lang.String hostList)
throws java.io.IOException
host - String like [host1]:[port1] [host2]:[port2] ...
java.io.IOExceptionjava.util.List<java.lang.String> getServersDescription()
void removeServer(java.lang.String hostList)
host - String like [host1]:[port1] [host2]:[port2] ...@Deprecated void setBufferAllocator(BufferAllocator bufferAllocator)
bufferAllocator -
<T> T get(java.lang.String key,
long timeout,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - Keytimeout - Operation timeout,if the method is not returned in this
time,throw TimeoutExceptiontranscoder - The value's transcoder
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> T get(java.lang.String key,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> T get(java.lang.String key,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> T get(java.lang.String key)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> GetsResponse<T> gets(java.lang.String key,
long timeout,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - keytimeout - operation timeouttranscoder -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> GetsResponse<T> gets(java.lang.String key)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> GetsResponse<T> gets(java.lang.String key,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> GetsResponse<T> gets(java.lang.String key,
Transcoder transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,T> get(java.util.Collection<java.lang.String> keyCollections,
long timeout,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - keyCollections - 关键字集合timeout - 操作超时时间transcoder - 数据项的反序列化转换器
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,T> get(java.util.Collection<java.lang.String> keyCollections,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,T> get(java.util.Collection<java.lang.String> keyCollections)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,T> get(java.util.Collection<java.lang.String> keyCollections,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,GetsResponse<T>> gets(java.util.Collection<java.lang.String> keyCollections,
long timeout,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - keyCollections - timeout - transcoder -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,GetsResponse<T>> gets(java.util.Collection<java.lang.String> keyCollections)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,GetsResponse<T>> gets(java.util.Collection<java.lang.String> keyCollections,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> java.util.Map<java.lang.String,GetsResponse<T>> gets(java.util.Collection<java.lang.String> keyCollections,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean set(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - stored keyexp - expire timevalue - stored datatranscoder - transocdertimeout - operation timeout,in milliseconds
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean set(java.lang.String key,
int exp,
java.lang.Object value)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean set(java.lang.String key,
int exp,
java.lang.Object value,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean set(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void setWithNoReply(java.lang.String key,
int exp,
java.lang.Object value)
throws java.lang.InterruptedException,
MemcachedException
T - key - stored keyexp - expire timevalue - stored datatranscoder - transocder
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void setWithNoReply(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
throws java.lang.InterruptedException,
MemcachedException
java.lang.InterruptedException
MemcachedException
<T> boolean add(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - exp - value - transcoder - timeout -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean add(java.lang.String key,
int exp,
java.lang.Object value)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean add(java.lang.String key,
int exp,
java.lang.Object value,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean add(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void addWithNoReply(java.lang.String key,
int exp,
java.lang.Object value)
throws java.lang.InterruptedException,
MemcachedException
T - key - exp - value - transcoder -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void addWithNoReply(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
throws java.lang.InterruptedException,
MemcachedException
java.lang.InterruptedException
MemcachedException
<T> boolean replace(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - exp - value - transcoder - timeout -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean replace(java.lang.String key,
int exp,
java.lang.Object value)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean replace(java.lang.String key,
int exp,
java.lang.Object value,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean replace(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void replaceWithNoReply(java.lang.String key,
int exp,
java.lang.Object value)
throws java.lang.InterruptedException,
MemcachedException
T - key - exp - value - transcoder -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void replaceWithNoReply(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder)
throws java.lang.InterruptedException,
MemcachedException
java.lang.InterruptedException
MemcachedException
boolean append(java.lang.String key,
java.lang.Object value)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean append(java.lang.String key,
java.lang.Object value,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - value - timeout -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void appendWithNoReply(java.lang.String key,
java.lang.Object value)
throws java.lang.InterruptedException,
MemcachedException
key - value -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean prepend(java.lang.String key,
java.lang.Object value)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean prepend(java.lang.String key,
java.lang.Object value,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - value -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void prependWithNoReply(java.lang.String key,
java.lang.Object value)
throws java.lang.InterruptedException,
MemcachedException
key - value -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean cas(java.lang.String key,
int exp,
java.lang.Object value,
long cas)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long timeout,
long cas)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - exp - value - transcoder - timeout - cas -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
boolean cas(java.lang.String key,
int exp,
java.lang.Object value,
long timeout,
long cas)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
int exp,
T value,
Transcoder<T> transcoder,
long cas)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
int exp,
CASOperation<T> operation,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - exp - 缓存数据项的超时时间operation - CASOperation对象,包装cas操作transcoder - 对象转换器
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation,
Transcoder<T> transcoder)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - exp - data item expire timegetsReponse - gets method's resultoperation - CASOperationtranscoder -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
GetsResponse<T> getsResponse,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
int exp,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> boolean cas(java.lang.String key,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void casWithNoReply(java.lang.String key,
GetsResponse<T> getsResponse,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
T - key - getsResponse - operation -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void casWithNoReply(java.lang.String key,
int exp,
GetsResponse<T> getsReponse,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void casWithNoReply(java.lang.String key,
int exp,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
<T> void casWithNoReply(java.lang.String key,
CASOperation<T> operation)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
@Deprecated
boolean delete(java.lang.String key,
int time)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - time -
java.lang.InterruptedException
MemcachedException
java.util.concurrent.TimeoutException
java.util.Map<java.net.InetSocketAddress,java.lang.String> getVersions()
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
long incr(java.lang.String key,
long delta)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - num -
java.lang.InterruptedException
MemcachedException
java.util.concurrent.TimeoutException
long incr(java.lang.String key,
long delta,
long initValue)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
long incr(java.lang.String key,
long delta,
long initValue,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - keynum - incrementinitValue - initValue if the data is not exists.timeout - operation timeout
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
long decr(java.lang.String key,
long delta)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - num -
java.lang.InterruptedException
MemcachedException
java.util.concurrent.TimeoutException
long decr(java.lang.String key,
long delta,
long initValue)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - num - initValue -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedExceptiondecr
long decr(java.lang.String key,
long delta,
long initValue,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - The keynum - The incrementinitValue - The initial value if the data is not exists.timeout - Operation timeout
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void flushAll()
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void flushAllWithNoReply()
throws java.lang.InterruptedException,
MemcachedException
java.lang.InterruptedException
MemcachedException
void flushAll(long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
timeout - operation timeout
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void flushAll(java.net.InetSocketAddress address)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
address - Target memcached servertimeout - operation timeout
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void flushAllWithNoReply(java.net.InetSocketAddress address)
throws MemcachedException,
java.lang.InterruptedException
MemcachedException
java.lang.InterruptedException
void flushAll(java.net.InetSocketAddress address,
long timeout)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
@Deprecated
void flushAll(java.lang.String host)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
host -
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
java.util.Map<java.lang.String,java.lang.String> stats(java.net.InetSocketAddress address)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
java.util.Map<java.lang.String,java.lang.String> stats(java.net.InetSocketAddress address,
long timeout)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
address - 节点地址timeout - 操作超时
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> getStats(long timeout)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
timeout -
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> getStats()
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> getStatsByItem(java.lang.String itemName)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
item -
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
void shutdown()
throws java.io.IOException
java.io.IOException
boolean delete(java.lang.String key)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedExceptionTranscoder getTranscoder()
void setTranscoder(Transcoder transcoder)
transcoder -
java.util.Map<java.net.InetSocketAddress,java.util.Map<java.lang.String,java.lang.String>> getStatsByItem(java.lang.String itemName,
long timeout)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionlong getOpTimeout()
void setOpTimeout(long opTimeout)
opTimeout -
java.util.Map<java.net.InetSocketAddress,java.lang.String> getVersions(long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedExceptionjava.util.Collection<java.net.InetSocketAddress> getAvaliableServers()
void addServer(java.lang.String server,
int port,
int weight)
throws java.io.IOException
server - port - weight -
java.io.IOException
void addServer(java.net.InetSocketAddress inetSocketAddress,
int weight)
throws java.io.IOException
java.io.IOException
@Deprecated
void deleteWithNoReply(java.lang.String key,
int time)
throws java.lang.InterruptedException,
MemcachedException
key - time -
java.lang.InterruptedException
MemcachedException
void deleteWithNoReply(java.lang.String key)
throws java.lang.InterruptedException,
MemcachedException
java.lang.InterruptedException
MemcachedException
void incrWithNoReply(java.lang.String key,
long delta)
throws java.lang.InterruptedException,
MemcachedException
key - num -
java.lang.InterruptedException
MemcachedException
void decrWithNoReply(java.lang.String key,
long delta)
throws java.lang.InterruptedException,
MemcachedException
key - num -
java.lang.InterruptedException
MemcachedException
void setLoggingLevelVerbosity(java.net.InetSocketAddress address,
int level)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
address - level - logging level
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void setLoggingLevelVerbosityWithNoReply(java.net.InetSocketAddress address,
int level)
throws java.lang.InterruptedException,
MemcachedException
address - memcached server addresslevel - logging level
java.lang.InterruptedException
MemcachedExceptionvoid addStateListener(MemcachedClientStateListener listener)
listener - void removeStateListener(MemcachedClientStateListener listener)
listener - java.util.Collection<MemcachedClientStateListener> getStateListeners()
void flushAllWithNoReply(int exptime)
throws java.lang.InterruptedException,
MemcachedException
java.lang.InterruptedException
MemcachedException
void flushAll(int exptime,
long timeout)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
void flushAllWithNoReply(java.net.InetSocketAddress address,
int exptime)
throws MemcachedException,
java.lang.InterruptedException
MemcachedException
java.lang.InterruptedException
void flushAll(java.net.InetSocketAddress address,
long timeout,
int exptime)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionvoid setHealSessionInterval(long healConnectionInterval)
healConnectionInterval - MILLISECONDSlong getHealSessionInterval()
Protocol getProtocol()
void setPrimitiveAsString(boolean primitiveAsString)
void setConnectionPoolSize(int poolSize)
poolSize - pool size,default is one,every memcached has only one
connection.void setEnableHeartBeat(boolean enableHeartBeat)
enableHeartBeat - if true,then enable heartbeat,true by defaultvoid setSanitizeKeys(boolean sanitizeKey)
sanitizeKey - if true, then URLEncode all keysboolean isSanitizeKeys()
Counter getCounter(java.lang.String key)
key -
Counter getCounter(java.lang.String key,
long initialValue)
key - initialValue -
KeyIterator getKeyIterator(java.net.InetSocketAddress address)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
address -
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionvoid setAuthInfoMap(java.util.Map<java.net.InetSocketAddress,AuthInfo> map)
map - Auth info map,key is memcached server address,and value is the
auth info for the key.java.util.Map<java.net.InetSocketAddress,AuthInfo> getAuthInfoMap()
long decr(java.lang.String key,
long delta,
long initValue,
long timeout,
int exp)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - delta - initValue - the initial value to be added when value is not foundtimeout - exp - the initial vlaue expire time
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedException
long incr(java.lang.String key,
long delta,
long initValue,
long timeout,
int exp)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException,
MemcachedException
key - keydelta - increment deltainitValue - the initial value to be added when value is not foundtimeout - operation timeoutexp - the initial vlaue expire time
java.util.concurrent.TimeoutException
java.lang.InterruptedException
MemcachedExceptionjava.lang.String getName()
void setName(java.lang.String name)
name - java.util.Queue<ReconnectRequest> getReconnectRequestQueue()
void setFailureMode(boolean failureMode)
failureMode - true is to configure client in failure mode.boolean isFailureMode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||