Class InvalidatedNearRemoteCache<K,V>
- java.lang.Object
-
- org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,V>
-
- org.infinispan.client.hotrod.impl.RemoteCacheImpl<K,V>
-
- org.infinispan.client.hotrod.impl.InvalidatedNearRemoteCache<K,V>
-
- Type Parameters:
K
-V
-
- All Implemented Interfaces:
ConcurrentMap<K,V>
,Map<K,V>
,RemoteCache<K,V>
,org.infinispan.commons.api.AsyncCache<K,V>
,org.infinispan.commons.api.BasicCache<K,V>
,org.infinispan.commons.api.Lifecycle
,org.infinispan.commons.api.TransactionalCache
public class InvalidatedNearRemoteCache<K,V> extends RemoteCacheImpl<K,V>
NearRemoteCache
implementation enabling
-
-
Field Summary
-
Fields inherited from class org.infinispan.client.hotrod.impl.RemoteCacheImpl
clientStatistics, operationsFactory
-
Fields inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport
defaultLifespan, defaultMaxIdleTime
-
-
Constructor Summary
Constructors Constructor Description InvalidatedNearRemoteCache(RemoteCacheManager rcm, String name, org.infinispan.commons.time.TimeService timeService, NearCacheService<K,V> nearcache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Void>
clearAsync()
Asynchronous version ofMap.clear()
.CompletableFuture<V>
getAsync(Object key)
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.CompletableFuture<MetadataValue<V>>
getWithMetadataAsync(K key)
Asynchronously returns theMetadataValue
associated to the supplied key param, or null if it doesn't exist.CompletableFuture<Void>
putAllAsync(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Synthetic operation.CompletableFuture<V>
putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Asynchronous version ofBasicCache.put(Object, Object, long, TimeUnit, long, TimeUnit)
.CompletableFuture<V>
removeAsync(Object key)
Asynchronous version ofBasicCache.remove(Object)
.CompletableFuture<Boolean>
removeWithVersionAsync(K key, long version)
CompletableFuture<V>
replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit)
.CompletableFuture<Boolean>
replaceWithVersionAsync(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
void
start()
Invoked on component startvoid
stop()
Invoked on component stop-
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheImpl
addClientListener, addClientListener, assertRemoteCacheManagerIsStarted, clear, clientStatistics, compute, computeAsync, containsKey, containsValue, entrySet, entrySet, execute, execute, get, getAll, getBulk, getBulk, getCacheTopologyInfo, getClientStatistics, getDataFormat, getListeners, getName, getOperationsFactory, getProtocolVersion, getRemoteCacheManager, getVersion, getVersioned, getWithMetadata, init, isEmpty, isObjectStorage, keySet, keySet, keyToBytes, ping, put, putAll, putIfAbsent, putIfAbsentAsync, remove, remove, removeClientListener, removeWithVersion, replace, replace, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, resolveStorage, retrieveEntries, retrieveEntries, retrieveEntries, retrieveEntriesByQuery, retrieveEntriesWithMetadata, serverStatistics, set, size, streaming, values, values, valueToBytes, withDataFormat, withFlags
-
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport
compute, compute, computeAsync, computeAsync, computeIfAbsent, computeIfAbsent, computeIfAbsent, computeIfAbsentAsync, computeIfAbsentAsync, computeIfAbsentAsync, computeIfPresent, computeIfPresent, computeIfPresent, computeIfPresentAsync, computeIfPresentAsync, computeIfPresentAsync, merge, merge, merge, mergeAsync, mergeAsync, mergeAsync, put, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, removeAsync, replace, replace, replace, replace, replaceAll, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync
-
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
containsKeyAsync, getAllAsync
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
forEach, getOrDefault
-
Methods inherited from interface org.infinispan.client.hotrod.RemoteCache
stats
-
-
-
-
Constructor Detail
-
InvalidatedNearRemoteCache
public InvalidatedNearRemoteCache(RemoteCacheManager rcm, String name, org.infinispan.commons.time.TimeService timeService, NearCacheService<K,V> nearcache)
-
-
Method Detail
-
getAsync
public CompletableFuture<V> getAsync(Object key)
Description copied from interface:org.infinispan.commons.api.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 interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Overrides:
getAsync
in classRemoteCacheImpl<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
public CompletableFuture<MetadataValue<V>> getWithMetadataAsync(K key)
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 classRemoteCacheImpl<K,V>
-
putAsync
public CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.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 interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Overrides:
putAsync
in classRemoteCacheImpl<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
Synthetic operation.- Specified by:
putAllAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Specified by:
putAllAsync
in interfaceRemoteCache<K,V>
- Overrides:
putAllAsync
in classRemoteCacheImpl<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:
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.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 interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Overrides:
replaceAsync
in classRemoteCacheImpl<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)
- Overrides:
replaceWithVersionAsync
in classRemoteCacheImpl<K,V>
-
removeAsync
public CompletableFuture<V> removeAsync(Object key)
Description copied from interface:org.infinispan.commons.api.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 interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Overrides:
removeAsync
in classRemoteCacheImpl<K,V>
- Parameters:
key
- key to remove- Returns:
- a future containing the value removed
-
removeWithVersionAsync
public CompletableFuture<Boolean> removeWithVersionAsync(K key, long version)
- Specified by:
removeWithVersionAsync
in interfaceRemoteCache<K,V>
- Overrides:
removeWithVersionAsync
in classRemoteCacheImpl<K,V>
- See Also:
RemoteCache.remove(Object, Object)
-
clearAsync
public CompletableFuture<Void> clearAsync()
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofMap.clear()
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
clearAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Overrides:
clearAsync
in classRemoteCacheImpl<K,V>
- Returns:
- a future containing a void return type
-
start
public void start()
Description copied from interface:org.infinispan.commons.api.Lifecycle
Invoked on component start- Specified by:
start
in interfaceorg.infinispan.commons.api.Lifecycle
- Overrides:
start
in classRemoteCacheImpl<K,V>
-
stop
public void stop()
Description copied from interface:org.infinispan.commons.api.Lifecycle
Invoked on component stop- Specified by:
stop
in interfaceorg.infinispan.commons.api.Lifecycle
- Overrides:
stop
in classRemoteCacheImpl<K,V>
-
-