Class InvalidatedNearRemoteCache<K,V>
java.lang.Object
org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,V>
org.infinispan.client.hotrod.impl.DelegatingRemoteCache<K,V>
org.infinispan.client.hotrod.impl.InvalidatedNearRemoteCache<K,V>
- Type Parameters:
K
-V
-
- All Implemented Interfaces:
ConcurrentMap<K,
,V> Map<K,
,V> InternalRemoteCache<K,
,V> RemoteCache<K,
,V> AsyncCache<K,
,V> BasicCache<K,
,V> Lifecycle
,TransactionalCache
Near
RemoteCache
implementation enabling-
Nested Class Summary
-
Field Summary
Fields inherited from class org.infinispan.client.hotrod.impl.DelegatingRemoteCache
delegate
Fields inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport
defaultLifespan, defaultMaxIdleTime
-
Method Summary
Modifier and TypeMethodDescriptionaddNearCacheListener
(Object listener, int bloomBits) Add a client listener to handle near cache with bloom filter optimization The listener object must be annotated with @ClientListener
annotation.Asynchronous version ofMap.clear()
.void
static <K,
V> InvalidatedNearRemoteCache<K, V> delegatingNearCache
(RemoteCacheImpl<K, V> remoteCache, NearCacheService<K, V> nearCacheService) Asynchronous version ofMap.get(Object)
that allows user code to retrieve the value associated with a key at a later stage, hence allowing multiple parallel get requests to be sent.getWithMetadataAsync
(K key) Asynchronously returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.putAllAsync
(Map<? extends K, ? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) Adds or overrides each specified entry in the remote cache.putAsync
(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) Asynchronous version ofBasicCache.put(Object, Object, long, TimeUnit, long, TimeUnit)
.removeAsync
(Object key) Asynchronous version ofBasicCache.remove(Object)
.removeWithVersionAsync
(K key, long version) replaceAsync
(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit)
.replaceWithVersionAsync
(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) void
resolveStorage
(MediaType key, MediaType value, boolean objectStorage) void
setBloomListenerAddress
(SocketAddress socketAddress) void
stop()
Invoked on component stopSends the current bloom filter to the listener node where a near cache listener is installed.Methods inherited from class org.infinispan.client.hotrod.impl.DelegatingRemoteCache
addClientListener, addClientListener, clientStatistics, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, containsKeyAsync, containsValue, entryIterator, entrySet, execute, getAllAsync, getCacheTopologyInfo, getDataFormat, getListeners, getName, getOperationsFactory, getProtocolVersion, getRemoteCacheContainer, getVersion, getWithMetadataAsync, hasForceReturnFlag, init, init, isEmpty, isObjectStorage, isTransactional, keyIterator, keySet, keyToBytes, mergeAsync, ping, publishEntries, publishEntriesByQuery, publishEntriesWithMetadata, putIfAbsentAsync, removeAsync, removeClientListener, replaceAll, replaceAsync, resolveStorage, retrieveEntries, retrieveEntriesByQuery, retrieveEntriesWithMetadata, serverStatistics, serverStatisticsAsync, sizeAsync, start, streaming, values, withDataFormat, withFlags
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport
clear, compute, compute, compute, computeAsync, computeAsync, computeIfAbsent, computeIfAbsent, computeIfAbsent, computeIfAbsentAsync, computeIfAbsentAsync, computeIfPresent, computeIfPresent, computeIfPresent, computeIfPresentAsync, computeIfPresentAsync, containsKey, get, getAll, getWithMetadata, merge, merge, merge, mergeAsync, mergeAsync, put, put, put, putAll, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, remove, remove, removeWithVersion, replace, replace, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceWithVersion, replaceWithVersion, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, replaceWithVersionAsync, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.infinispan.commons.api.AsyncCache
computeAsync, computeAsync, computeIfAbsentAsync, computeIfAbsentAsync, computeIfPresentAsync, computeIfPresentAsync, mergeAsync, mergeAsync, putAsync, putAsync, putIfAbsentAsync, putIfAbsentAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync
Methods inherited from interface org.infinispan.commons.api.BasicCache
compute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, 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
Methods inherited from interface org.infinispan.client.hotrod.impl.InternalRemoteCache
removeEntry, removeEntry
Methods inherited from interface org.infinispan.client.hotrod.RemoteCache
entrySet, execute, execute, getAll, getRemoteCacheManager, getWithMetadata, keySet, putAll, putAll, putAll, putAllAsync, putAllAsync, remove, remove, removeWithVersion, replace, replace, replace, replaceWithVersion, replaceWithVersion, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, replaceWithVersionAsync, retrieveEntries, retrieveEntries, stats, values
Methods inherited from interface org.infinispan.commons.api.TransactionalCache
getTransactionManager
-
Method Details
-
delegatingNearCache
public static <K,V> InvalidatedNearRemoteCache<K,V> delegatingNearCache(RemoteCacheImpl<K, V> remoteCache, NearCacheService<K, V> nearCacheService) -
getAsync
Description copied from interface:AsyncCache
Asynchronous version ofMap.get(Object)
that allows user code to retrieve the value associated with a key at a later stage, hence allowing multiple parallel get requests to be sent. Normally, when this method detects that the value is likely to be retrieved from from a remote entity, it will span a different thread in order to allow the asynchronous get call to return immediately. If the call will definitely resolve locally, for example when the cache is configured with LOCAL mode and no stores are configured, the get asynchronous call will act sequentially and will have no different toMap.get(Object)
.- Specified by:
getAsync
in interfaceAsyncCache<K,
V> - Overrides:
getAsync
in classDelegatingRemoteCache<K,
V> - Parameters:
key
- key to retrieve- Returns:
- a future that can be used to retrieve value associated with the
key when this is available. The actual value returned by the future
follows the same rules as
Map.get(Object)
-
getWithMetadataAsync
Description copied from interface:RemoteCache
Asynchronously returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.- Specified by:
getWithMetadataAsync
in interfaceRemoteCache<K,
V> - Overrides:
getWithMetadataAsync
in classDelegatingRemoteCache<K,
V>
-
putAsync
public CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) Description copied from interface:AsyncCache
Asynchronous version ofBasicCache.put(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
putAsync
in interfaceAsyncCache<K,
V> - Overrides:
putAsync
in classDelegatingRemoteCache<K,
V> - Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- 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:
- a future containing the old value replaced
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K, ? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) Description copied from interface:RemoteCache
Adds or overrides each specified entry in the remote cache. This operation provides better performance than calling put() for each entry.- Specified by:
putAllAsync
in interfaceAsyncCache<K,
V> - Specified by:
putAllAsync
in interfaceRemoteCache<K,
V> - Overrides:
putAllAsync
in classDelegatingRemoteCache<K,
V> - Parameters:
map
- to storelifespan
- lifespan of entrylifespanUnit
- 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:
- a future containing a void return type
- See Also:
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) Description copied from interface:AsyncCache
Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
replaceAsync
in interfaceAsyncCache<K,
V> - Overrides:
replaceAsync
in classDelegatingRemoteCache<K,
V> - Parameters:
key
- key to removevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- 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:
- a future containing the previous value overwritten
-
replaceWithVersionAsync
public CompletableFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit) - Specified by:
replaceWithVersionAsync
in interfaceRemoteCache<K,
V> - Overrides:
replaceWithVersionAsync
in classDelegatingRemoteCache<K,
V> - See Also:
-
removeAsync
Description copied from interface:AsyncCache
Asynchronous version ofBasicCache.remove(Object)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
removeAsync
in interfaceAsyncCache<K,
V> - Overrides:
removeAsync
in classDelegatingRemoteCache<K,
V> - Parameters:
key
- key to remove- Returns:
- a future containing the value removed
-
removeWithVersionAsync
- Specified by:
removeWithVersionAsync
in interfaceRemoteCache<K,
V> - Overrides:
removeWithVersionAsync
in classDelegatingRemoteCache<K,
V> - See Also:
-
clearAsync
Description copied from interface:AsyncCache
Asynchronous version ofMap.clear()
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
clearAsync
in interfaceAsyncCache<K,
V> - Overrides:
clearAsync
in classDelegatingRemoteCache<K,
V> - Returns:
- a future containing a void return type
-
resolveStorage
-
stop
public void stop()Description copied from interface:Lifecycle
Invoked on component stop -
clearNearCache
public void clearNearCache() -
updateBloomFilter
Description copied from interface:InternalRemoteCache
Sends the current bloom filter to the listener node where a near cache listener is installed. If this cache does not have near caching this will return an already completed stage.- Specified by:
updateBloomFilter
in interfaceInternalRemoteCache<K,
V> - Overrides:
updateBloomFilter
in classDelegatingRemoteCache<K,
V> - Returns:
- stage that when complete the filter was sent to the listener node
-
getBloomListenerAddress
-
setBloomListenerAddress
-
addNearCacheListener
Description copied from interface:InternalRemoteCache
Add a client listener to handle near cache with bloom filter optimization The listener object must be annotated with @ClientListener
annotation.- Specified by:
addNearCacheListener
in interfaceInternalRemoteCache<K,
V> - Overrides:
addNearCacheListener
in classDelegatingRemoteCache<K,
V>
-