Interface RemoteCache<K,V>
-
- All Superinterfaces:
AsyncCache<K,V>
,BasicCache<K,V>
,java.util.concurrent.ConcurrentMap<K,V>
,Lifecycle
,java.util.Map<K,V>
,TransactionalCache
public interface RemoteCache<K,V> extends BasicCache<K,V>, TransactionalCache
Provides remote reference to a Hot Rod server/cluster. It implementsCache
, but given its nature (remote) some operations are not supported. All these unsupported operations are being overridden within this interface and documented as such. New operations: besides the operations inherited fromCache
, RemoteCache also adds new operations to optimize/reduce network traffic: e.g. versioned put operation. Concurrency: implementors of this interface will support multi-threaded access, similar to the wayCache
supports it. Return values: previously existing values for certainMap
operations are not returned, null is returned instead. E.g.Map.put(Object, Object)
returns the previous value associated to the supplied key. In case of RemoteCache, this returns null. Synthetic operations: aggregate operations are being implemented based on other Hot Rod operations. E.g. all theMap.putAll(java.util.Map)
is implemented through multiple individual puts. This means that the these operations are not atomic and that they are costly, e.g. as the number of network round-trips is not one, but the size of the added map. All these synthetic operations are documented as such. changing default behavior throughFlag
s: it is possible to change the default cache behaviour by using flags on an per invocation basis. E.g.RemoteCache cache = getRemoteCache(); Object oldValue = cache.withFlags(Flag.FORCE_RETURN_VALUE).put(aKey, aValue);
In the previous example, usingFlag.FORCE_RETURN_VALUE
will make the client to also return previously existing value associated with aKey. If this flag would not be present, Infinispan would return (by default) null. This is in order to avoid fetching a possibly large object from the remote server, which might not be needed. The flags as set by thewithFlags(Flag...)
operation only apply for the very next operation executed by the same thread on the RemoteCache. Note on default expiration values: Due to limitations on the first version of the protocol, it's not possible for clients to rely on default lifespan and maxIdle values set on the server. This is because the protocol does not support a way to tell the server that no expiration lifespan and/or maxIdle were provided and that default values should be used. This will be resolved in a future revision of the protocol. In the mean time, the workaround is to explicitly provide the desired expiry lifespan/maxIdle values in each remote cache operation.- Since:
- 4.1
- Author:
- Mircea.Markus@jboss.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addClientListener(java.lang.Object listener)
Add a client listener to receive events that happen in the remote cache.void
addClientListener(java.lang.Object listener, java.lang.Object[] filterFactoryParams, java.lang.Object[] converterFactoryParams)
Add a client listener to receive events that happen in the remote cache.RemoteCacheClientStatisticsMXBean
clientStatistics()
Returns client-side statistics for this cache.CloseableIteratorSet<java.util.Map.Entry<K,V>>
entrySet()
CloseableIteratorSet<java.util.Map.Entry<K,V>>
entrySet(IntSet segments)
This method is identical toentrySet()
except that it will only return entries that map to the given segments.<T> T
execute(java.lang.String scriptName, java.util.Map<java.lang.String,?> params)
Executes a remote script passing a set of named parametersdefault <T> T
execute(java.lang.String scriptName, java.util.Map<java.lang.String,?> params, java.lang.Object key)
Executes a remote script passing a set of named parameters, hinting that the script should be executed on the server that is expected to store given key.java.util.Map<K,V>
getAll(java.util.Set<? extends K> keys)
Retrieves all of the entries for the provided keys.CacheTopologyInfo
getCacheTopologyInfo()
ReturnsCacheTopologyInfo
for this cache.DataFormat
getDataFormat()
Return the currentlyDataFormat
being used.java.util.Set<java.lang.Object>
getListeners()
Deprecated.Since 10.0, with no replacementjava.lang.String
getProtocolVersion()
Returns the HotRod protocol version supported by this RemoteCache implementationRemoteCacheManager
getRemoteCacheManager()
Returns theRemoteCacheManager
that created this cache.VersionedValue<V>
getVersioned(K key)
Deprecated.UsegetWithMetadata(Object)
insteadMetadataValue<V>
getWithMetadata(K key)
Returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.java.util.concurrent.CompletableFuture<MetadataValue<V>>
getWithMetadataAsync(K key)
Asynchronously returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.boolean
isTransactional()
CloseableIteratorSet<K>
keySet()
CloseableIteratorSet<K>
keySet(IntSet segments)
This method is identical tokeySet()
except that it will only return keys that map to the given segments.void
putAll(java.util.Map<? extends K,? extends V> m)
Synthetic operation.void
putAll(java.util.Map<? extends K,? extends V> map, long lifespan, java.util.concurrent.TimeUnit unit)
Synthetic operation.void
putAll(java.util.Map<? extends K,? extends V> map, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleTimeUnit)
Synthetic operation.java.util.concurrent.CompletableFuture<java.lang.Void>
putAllAsync(java.util.Map<? extends K,? extends V> data)
Synthetic operation.java.util.concurrent.CompletableFuture<java.lang.Void>
putAllAsync(java.util.Map<? extends K,? extends V> data, long lifespan, java.util.concurrent.TimeUnit unit)
Synthetic operation.java.util.concurrent.CompletableFuture<java.lang.Void>
putAllAsync(java.util.Map<? extends K,? extends V> data, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleUnit)
Synthetic operation.V
remove(java.lang.Object key)
If the return value of this operation will be ignored by the application, the user is strongly encouraged to use theFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently as possible (i.e.boolean
remove(java.lang.Object key, java.lang.Object value)
void
removeClientListener(java.lang.Object listener)
Remove a previously added client listener.boolean
removeWithVersion(K key, long version)
Removes the given entry only if its version matches the supplied version.java.util.concurrent.CompletableFuture<java.lang.Boolean>
removeWithVersionAsync(K key, long version)
boolean
replace(K key, V oldValue, V newValue)
boolean
replace(K key, V oldValue, V value, long lifespan, java.util.concurrent.TimeUnit unit)
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.boolean
replace(K key, V oldValue, V value, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.boolean
replaceWithVersion(K key, V newValue, long version)
Replaces the given value only if its version matches the supplied version.boolean
replaceWithVersion(K key, V newValue, long version, int lifespanSeconds)
A overloaded form ofreplaceWithVersion(Object, Object, long)
which takes in lifespan parameters.boolean
replaceWithVersion(K key, V newValue, long version, int lifespanSeconds, int maxIdleTimeSeconds)
A overloaded form ofreplaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.boolean
replaceWithVersion(K key, V newValue, long version, long lifespan, java.util.concurrent.TimeUnit lifespanTimeUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleTimeUnit)
A overloaded form ofreplaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.java.util.concurrent.CompletableFuture<java.lang.Boolean>
replaceWithVersionAsync(K key, V newValue, long version)
java.util.concurrent.CompletableFuture<java.lang.Boolean>
replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds)
java.util.concurrent.CompletableFuture<java.lang.Boolean>
replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds, int maxIdleSeconds)
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>>
retrieveEntries(java.lang.String filterConverterFactory, int batchSize)
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>>
retrieveEntries(java.lang.String filterConverterFactory, java.lang.Object[] filterConverterParams, java.util.Set<java.lang.Integer> segments, int batchSize)
Retrieve entries from the serverCloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>>
retrieveEntries(java.lang.String filterConverterFactory, java.util.Set<java.lang.Integer> segments, int batchSize)
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>>
retrieveEntriesByQuery(Query filterQuery, java.util.Set<java.lang.Integer> segments, int batchSize)
Retrieve entries from the server matching a query.CloseableIterator<java.util.Map.Entry<java.lang.Object,MetadataValue<java.lang.Object>>>
retrieveEntriesWithMetadata(java.util.Set<java.lang.Integer> segments, int batchSize)
Retrieve entries with metadata informationServerStatistics
serverStatistics()
Returns server-side statistics for this cache.default ServerStatistics
stats()
Deprecated.useserverStatistics()
insteadStreamingRemoteCache<K>
streaming()
Returns a cache where values are manipulated usingInputStream
andOutputStream
CloseableIteratorCollection<V>
values()
CloseableIteratorCollection<V>
values(IntSet segments)
This method is identical tovalues()
except that it will only return values that map to the given segments.<T,U>
RemoteCache<T,U>withDataFormat(DataFormat dataFormat)
Return a new instance ofRemoteCache
using the suppliedDataFormat
.RemoteCache<K,V>
withFlags(Flag... flags)
Applies one or moreFlag
s to the scope of a single invocation.-
Methods inherited from interface org.infinispan.commons.api.AsyncCache
clearAsync, computeAsync, computeAsync, computeAsync, computeIfAbsentAsync, computeIfAbsentAsync, computeIfAbsentAsync, computeIfPresentAsync, computeIfPresentAsync, computeIfPresentAsync, containsKeyAsync, getAllAsync, getAsync, mergeAsync, mergeAsync, mergeAsync, putAsync, putAsync, putAsync, putIfAbsentAsync, putIfAbsentAsync, putIfAbsentAsync, removeAsync, removeAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, sizeAsync
-
Methods inherited from interface org.infinispan.commons.api.BasicCache
compute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, getName, getVersion, merge, merge, put, put, put, putIfAbsent, putIfAbsent, replace, replace
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, replace, replaceAll
-
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, size
-
Methods inherited from interface org.infinispan.commons.api.TransactionalCache
getTransactionManager
-
-
-
-
Method Detail
-
removeWithVersion
boolean removeWithVersion(K key, long version)
Removes the given entry only if its version matches the supplied version. A typical use case looks like this:VersionedEntry ve = remoteCache.getVersioned(key); //some processing remoteCache.removeWithVersion(key, ve.getVersion();
Lat call (removeWithVersion) will make sure that the entry will only be removed if it hasn't been changed in between.- Returns:
- true if the entry has been removed
- See Also:
VersionedValue
,getVersioned(Object)
-
remove
V remove(java.lang.Object key)
If the return value of this operation will be ignored by the application, the user is strongly encouraged to use theFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently as possible (i.e. avoiding needless remote or network calls).The returned value is only sent back if
Flag.FORCE_RETURN_VALUE
is enabled.
-
remove
boolean remove(java.lang.Object key, java.lang.Object value)
This method requires 2 round trips to the server. The first to retrieve the value and version and a second to remove the key with the version if the value matches. If possible user should use
getWithMetadata(Object)
andremoveWithVersion(Object, long)
.
-
replace
boolean replace(K key, V oldValue, V newValue)
This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use
getWithMetadata(Object)
andreplaceWithVersion(Object, Object, long)
.
-
replace
boolean replace(K key, V oldValue, V value, long lifespan, java.util.concurrent.TimeUnit unit)
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use
getWithMetadata(Object)
andreplaceWithVersion(Object, Object, long, long, TimeUnit, long, TimeUnit)
.- Specified by:
replace
in interfaceBasicCache<K,V>
- Parameters:
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan- Returns:
- true if the value was replaced, false otherwise
-
replace
boolean replace(K key, V oldValue, V value, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use
getWithMetadata(Object)
andreplaceWithVersion(Object, Object, long, long, TimeUnit, long, TimeUnit)
if possible.- Specified by:
replace
in interfaceBasicCache<K,V>
- Parameters:
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- true if the value was replaced, false otherwise
-
removeWithVersionAsync
java.util.concurrent.CompletableFuture<java.lang.Boolean> removeWithVersionAsync(K key, long version)
- See Also:
remove(Object, Object)
-
replaceWithVersion
boolean replaceWithVersion(K key, V newValue, long version)
Replaces the given value only if its version matches the supplied version. SeeremoveWithVersion(Object, long)
for a sample usage of the version-based methods.- Parameters:
version
- numeric version that should match the one in the server for the operation to succeed- Returns:
- true if the value has been replaced
- See Also:
getVersioned(Object)
,VersionedValue
-
replaceWithVersion
boolean replaceWithVersion(K key, V newValue, long version, int lifespanSeconds)
A overloaded form ofreplaceWithVersion(Object, Object, long)
which takes in lifespan parameters.- Parameters:
key
- key to usenewValue
- new value to be associated with the keyversion
- numeric version that should match the one in the server for the operation to succeedlifespanSeconds
- lifespan of the entry- Returns:
- true if the value was replaced
-
replaceWithVersion
boolean replaceWithVersion(K key, V newValue, long version, int lifespanSeconds, int maxIdleTimeSeconds)
A overloaded form ofreplaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.- Parameters:
key
- key to usenewValue
- new value to be associated with the keyversion
- numeric version that should match the one in the server for the operation to succeedlifespanSeconds
- lifespan of the entrymaxIdleTimeSeconds
- the maximum amount of time this key is allowed to be idle for before it is considered as expired- Returns:
- true if the value was replaced
-
replaceWithVersion
boolean replaceWithVersion(K key, V newValue, long version, long lifespan, java.util.concurrent.TimeUnit lifespanTimeUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleTimeUnit)
A overloaded form ofreplaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.- Parameters:
key
- key to usenewValue
- new value to be associated with the keyversion
- numeric version that should match the one in the server for the operation to succeedlifespan
- lifespan of the entrylifespanTimeUnit
-TimeUnit
for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
-TimeUnit
for maxIdle- Returns:
- true if the value was replaced
-
replaceWithVersionAsync
java.util.concurrent.CompletableFuture<java.lang.Boolean> replaceWithVersionAsync(K key, V newValue, long version)
- See Also:
replaceWithVersion(Object, Object, long)
-
replaceWithVersionAsync
java.util.concurrent.CompletableFuture<java.lang.Boolean> replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds)
- See Also:
replaceWithVersion(Object, Object, long)
-
replaceWithVersionAsync
java.util.concurrent.CompletableFuture<java.lang.Boolean> replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds, int maxIdleSeconds)
- See Also:
replaceWithVersion(Object, Object, long)
-
retrieveEntries
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>> retrieveEntries(java.lang.String filterConverterFactory, java.util.Set<java.lang.Integer> segments, int batchSize)
-
retrieveEntries
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>> retrieveEntries(java.lang.String filterConverterFactory, java.lang.Object[] filterConverterParams, java.util.Set<java.lang.Integer> segments, int batchSize)
Retrieve entries from the server- Parameters:
filterConverterFactory
- Factory name for the KeyValueFilterConverter or null for no filtering.filterConverterParams
- Parameters to the KeyValueFilterConvertersegments
- The segments to iterate. If null all segments will be iterated. An empty set will filter out all entries.batchSize
- The number of entries transferred from the server at a time.- Returns:
- Iterator for the entries
-
retrieveEntries
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>> retrieveEntries(java.lang.String filterConverterFactory, int batchSize)
-
retrieveEntriesByQuery
CloseableIterator<java.util.Map.Entry<java.lang.Object,java.lang.Object>> retrieveEntriesByQuery(Query filterQuery, java.util.Set<java.lang.Integer> segments, int batchSize)
Retrieve entries from the server matching a query.- Parameters:
filterQuery
-Query
segments
- The segments to iterate. If null all segments will be iterated. An empty set will filter out all entries.batchSize
- The number of entries transferred from the server at a time.- Returns:
CloseableIterator
-
retrieveEntriesWithMetadata
CloseableIterator<java.util.Map.Entry<java.lang.Object,MetadataValue<java.lang.Object>>> retrieveEntriesWithMetadata(java.util.Set<java.lang.Integer> segments, int batchSize)
Retrieve entries with metadata information
-
getVersioned
@Deprecated VersionedValue<V> getVersioned(K key)
Deprecated.UsegetWithMetadata(Object)
insteadReturns theVersionedValue
associated to the supplied key param, or null if it doesn't exist.
-
getWithMetadata
MetadataValue<V> getWithMetadata(K key)
Returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.
-
getWithMetadataAsync
java.util.concurrent.CompletableFuture<MetadataValue<V>> getWithMetadataAsync(K key)
Asynchronously returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.
-
keySet
CloseableIteratorSet<K> keySet()
-
keySet
CloseableIteratorSet<K> keySet(IntSet segments)
This method is identical tokeySet()
except that it will only return keys that map to the given segments. Note that these segments will be determined by the remote server. Thus you should be aware of how many segments it has configured and hashing algorithm it is using. If the segments and hashing algorithm are not the same this method may return unexpected keys.- Parameters:
segments
- the segments of keys to return - null means all available- Returns:
- set containing keys that map to the given segments
- Since:
- 9.4
- See Also:
keySet()
-
values
CloseableIteratorCollection<V> values()
-
values
CloseableIteratorCollection<V> values(IntSet segments)
This method is identical tovalues()
except that it will only return values that map to the given segments. Note that these segments will be determined by the remote server. Thus you should be aware of how many segments it has configured and hashing algorithm it is using. If the segments and hashing algorithm are not the same this method may return unexpected values.- Parameters:
segments
- the segments of values to return - null means all available- Returns:
- collection containing values that map to the given segments
- Since:
- 9.4
- See Also:
values()
-
entrySet
CloseableIteratorSet<java.util.Map.Entry<K,V>> entrySet()
-
entrySet
CloseableIteratorSet<java.util.Map.Entry<K,V>> entrySet(IntSet segments)
This method is identical toentrySet()
except that it will only return entries that map to the given segments. Note that these segments will be determined by the remote server. Thus you should be aware of how many segments it has configured and hashing algorithm it is using. If the segments and hashing algorithm are not the same this method may return unexpected entries.- Parameters:
segments
- the segments of entries to return - null means all available- Returns:
- set containing entries that map to the given segments
- Since:
- 9.4
- See Also:
entrySet()
-
putAll
void putAll(java.util.Map<? extends K,? extends V> map, long lifespan, java.util.concurrent.TimeUnit unit)
Synthetic operation. The client iterates over the set of keys and calls put for each one of them. This results in operation not being atomic (if a failure happens after few puts it is not rolled back) and costly (for each key in the parameter map a remote call is performed).- Specified by:
putAll
in interfaceBasicCache<K,V>
- Parameters:
map
- map containing mappings to enterlifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan
-
putAll
void putAll(java.util.Map<? extends K,? extends V> map, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdleTime, java.util.concurrent.TimeUnit maxIdleTimeUnit)
Synthetic operation.- Specified by:
putAll
in interfaceBasicCache<K,V>
- Parameters:
map
- map containing mappings to enterlifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- See Also:
putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAllAsync
java.util.concurrent.CompletableFuture<java.lang.Void> putAllAsync(java.util.Map<? extends K,? extends V> data)
Synthetic operation.- Specified by:
putAllAsync
in interfaceAsyncCache<K,V>
- Parameters:
data
- to store- Returns:
- a future containing a void return type
- See Also:
putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAllAsync
java.util.concurrent.CompletableFuture<java.lang.Void> putAllAsync(java.util.Map<? extends K,? extends V> data, long lifespan, java.util.concurrent.TimeUnit unit)
Synthetic operation.- Specified by:
putAllAsync
in interfaceAsyncCache<K,V>
- Parameters:
data
- to storelifespan
- lifespan of entryunit
- time unit for lifespan- Returns:
- a future containing a void return type
- See Also:
putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAllAsync
java.util.concurrent.CompletableFuture<java.lang.Void> putAllAsync(java.util.Map<? extends K,? extends V> data, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleUnit)
Synthetic operation.- Specified by:
putAllAsync
in interfaceAsyncCache<K,V>
- Parameters:
data
- to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
- time unit for max idle time- Returns:
- a future containing a void return type
- See Also:
putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAll
void putAll(java.util.Map<? extends K,? extends V> m)
Synthetic operation.- Specified by:
putAll
in interfacejava.util.Map<K,V>
- See Also:
putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
stats
@Deprecated default ServerStatistics stats()
Deprecated.useserverStatistics()
insteadReturns server-side statistics for this cache.
-
clientStatistics
RemoteCacheClientStatisticsMXBean clientStatistics()
Returns client-side statistics for this cache.
-
serverStatistics
ServerStatistics serverStatistics()
Returns server-side statistics for this cache.
-
withFlags
RemoteCache<K,V> withFlags(Flag... flags)
Applies one or moreFlag
s to the scope of a single invocation. See theFlag
enumeration to for information on available flags. Sample usage:remoteCache.withFlags(Flag.FORCE_RETURN_VALUE).put("hello", "world");
- Parameters:
flags
-- Returns:
- the current RemoteCache instance to continue running operations on.
-
getRemoteCacheManager
RemoteCacheManager getRemoteCacheManager()
Returns theRemoteCacheManager
that created this cache.
-
getAll
java.util.Map<K,V> getAll(java.util.Set<? extends K> keys)
Retrieves all of the entries for the provided keys. A key will not be present in the resulting map if the entry was not found in the cache.- Parameters:
keys
- The keys to find values for- Returns:
- The entries that were present for the given keys
-
getProtocolVersion
java.lang.String getProtocolVersion()
Returns the HotRod protocol version supported by this RemoteCache implementation
-
addClientListener
void addClientListener(java.lang.Object listener)
Add a client listener to receive events that happen in the remote cache. The listener object must be annotated with @ClientListener
annotation.
-
addClientListener
void addClientListener(java.lang.Object listener, java.lang.Object[] filterFactoryParams, java.lang.Object[] converterFactoryParams)
Add a client listener to receive events that happen in the remote cache. The listener object must be annotated with @ClientListener annotation.
-
removeClientListener
void removeClientListener(java.lang.Object listener)
Remove a previously added client listener. If the listener was not added before, this operation is a no-op.
-
getListeners
@Deprecated java.util.Set<java.lang.Object> getListeners()
Deprecated.Since 10.0, with no replacementReturns a set with all the listeners registered by this client for the given cache.
-
execute
<T> T execute(java.lang.String scriptName, java.util.Map<java.lang.String,?> params)
Executes a remote script passing a set of named parameters
-
execute
default <T> T execute(java.lang.String scriptName, java.util.Map<java.lang.String,?> params, java.lang.Object key)
Executes a remote script passing a set of named parameters, hinting that the script should be executed on the server that is expected to store given key. The key itself is not transferred to the server.
-
getCacheTopologyInfo
CacheTopologyInfo getCacheTopologyInfo()
ReturnsCacheTopologyInfo
for this cache.
-
streaming
StreamingRemoteCache<K> streaming()
Returns a cache where values are manipulated usingInputStream
andOutputStream
-
withDataFormat
<T,U> RemoteCache<T,U> withDataFormat(DataFormat dataFormat)
Return a new instance ofRemoteCache
using the suppliedDataFormat
.
-
getDataFormat
DataFormat getDataFormat()
Return the currentlyDataFormat
being used.
-
isTransactional
boolean isTransactional()
- Returns:
true
if the cache can participate in a transaction,false
otherwise.
-
-