public interface MemcacheClient<V> extends ObservableClient
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<MemcacheStatus> |
add(java.lang.String key,
V value,
int ttl)
Add a key in memcache with the provided value, with the specified TTL.
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
append(java.lang.String key,
V value) |
java.util.concurrent.CompletionStage<java.util.List<GetResult<V>>> |
casGet(java.util.List<java.lang.String> keys)
Get the value for the provided keys
|
java.util.concurrent.CompletionStage<GetResult<V>> |
casGet(java.lang.String key)
Get the value for the provided key, including the CAS value
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
delete(java.lang.String key)
Delete the provided key
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
delete(java.lang.String key,
long cas)
Deletes a key with CAS check.
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
deleteAll(java.lang.String key)
Delete the provided key on all memcached instances.
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
flushAll(int delay)
Flushes all entries in the storage
|
java.util.concurrent.CompletionStage<java.util.List<V>> |
get(java.util.List<java.lang.String> keys)
Get the value for the provided keys
|
java.util.concurrent.CompletionStage<V> |
get(java.lang.String key)
Get the value for the provided key
|
RawMemcacheClient |
getRawMemcacheClient()
Note: This is typically only useful for testing and debugging
|
java.util.concurrent.CompletionStage<java.util.Map<java.lang.String,MemcachedStats>> |
getStats(java.lang.String key)
Get raw statistics from the memcached instances.
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
prepend(java.lang.String key,
V value) |
java.util.concurrent.CompletionStage<MemcacheStatus> |
replace(java.lang.String key,
V value,
int ttl)
Replace a key in memcache with the provided value, with the specified TTL.
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
set(java.lang.String key,
V value,
int ttl)
Set a key in memcache to the provided value, with the specified TTL
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
set(java.lang.String key,
V value,
int ttl,
long cas)
Compare and set a key in memcache to the provided value, with the specified TTL
|
void |
shutdown()
Shut down the client.
|
java.util.concurrent.CompletionStage<MemcacheStatus> |
touch(java.lang.String key,
int ttl)
Sets the expiration for the provided key
|
awaitConnected, awaitDisconnected, awaitFullyConnected, awaitFullyDisconnected, awaitFuture, connectFuture, disconnectFuture, fullyConnectedFuture, fullyDisconnectFuture, getConnectionFailure, isConnected, numActiveConnections, numTotalConnections, registerForConnectionChanges, unregisterForConnectionChangesjava.util.concurrent.CompletionStage<MemcacheStatus> set(java.lang.String key, V value, int ttl)
key - The key, must not be nullvalue - The value, must not be nullttl - The TTL in secondsjava.util.concurrent.CompletionStage<MemcacheStatus> set(java.lang.String key, V value, int ttl, long cas)
key - The key, must not be nullvalue - The value, must not be nullttl - The TTL in secondscas - The CAS value, must match the value on the server for the set to go throughjava.util.concurrent.CompletionStage<MemcacheStatus> delete(java.lang.String key)
key - Key, must not be nulljava.util.concurrent.CompletionStage<MemcacheStatus> delete(java.lang.String key, long cas)
key - The key, must not be nullcas - The CAS value, must match the value on the server for the set to go throughjava.util.concurrent.CompletionStage<MemcacheStatus> deleteAll(java.lang.String key)
key - Key, must not be nulljava.util.concurrent.CompletionStage<MemcacheStatus> add(java.lang.String key, V value, int ttl)
key - The key, must not be nullvalue - The value, must not be nullttl - The TTL in secondsjava.util.concurrent.CompletionStage<MemcacheStatus> replace(java.lang.String key, V value, int ttl)
key - The key, must not be nullvalue - The value, must not be nullttl - The TTL in secondsjava.util.concurrent.CompletionStage<MemcacheStatus> append(java.lang.String key, V value)
java.util.concurrent.CompletionStage<MemcacheStatus> prepend(java.lang.String key, V value)
java.util.concurrent.CompletionStage<V> get(java.lang.String key)
key - The key, must not be nulljava.util.concurrent.CompletionStage<GetResult<V>> casGet(java.lang.String key)
key - First key, must not be nulljava.util.concurrent.CompletionStage<java.util.List<V>> get(java.util.List<java.lang.String> keys)
keys - Keys, must not be null, nor must any key in the listjava.util.concurrent.CompletionStage<java.util.List<GetResult<V>>> casGet(java.util.List<java.lang.String> keys)
keys - Keys, must not be null, nor must any key in the listjava.util.concurrent.CompletionStage<MemcacheStatus> touch(java.lang.String key, int ttl)
key - First key, must not be nullttl - The TTL in secondsjava.util.concurrent.CompletionStage<MemcacheStatus> flushAll(int delay)
delay - The flush delay in seconds.java.util.concurrent.CompletionStage<java.util.Map<java.lang.String,MemcachedStats>> getStats(java.lang.String key)
The reason for including potentially multiple statistics containers is to support the ketama use-case where there may be multiple memcached instances.
If any of the instances fail to return statistics, the exception will be propagated.
Valid keys are:
key - - statistics key.void shutdown()
RawMemcacheClient getRawMemcacheClient()
Copyright © 2020 Spotify AB. All Rights Reserved.