Class TransactionalRemoteCacheImpl<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.transaction.TransactionalRemoteCacheImpl<K,V>
-
- All Implemented Interfaces:
ConcurrentMap<K,V>,Map<K,V>,InternalRemoteCache<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 TransactionalRemoteCacheImpl<K,V> extends RemoteCacheImpl<K,V>
ARemoteCacheimplementation that handlesTransaction.All streaming operation (example
RemoteCache.retrieveEntries(String, int)) andRemoteCacheSupport.size()aren't transactional in a way they don't interact with the transaction's data (keys, values).containsValue(Object)is a special case where a key with the specific value is marked as read for the transaction.- Since:
- 9.3
- Author:
- Pedro Ruivo
-
-
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 TransactionalRemoteCacheImpl(RemoteCacheManager rcm, String name, boolean forceReturnValue, boolean recoveryEnabled, TransactionManager transactionManager, TransactionTable transactionTable, org.infinispan.commons.time.TimeService timeService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<Boolean>containsKeyAsync(K key)booleancontainsValue(Object value)CompletableFuture<V>getAsync(Object key)TransactionManagergetTransactionManager()CompletableFuture<MetadataValue<V>>getWithMetadataAsync(K key)Asynchronously returns theMetadataValueassociated to the supplied key param, or null if it doesn't exist.booleanisTransactional()CompletableFuture<Void>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.CompletableFuture<V>putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)CompletableFuture<V>putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)CompletableFuture<V>removeAsync(Object key)CompletableFuture<Boolean>removeAsync(Object key, Object value)CompletableFuture<Boolean>removeWithVersionAsync(K key, long version)CompletableFuture<V>replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)CompletableFuture<Boolean>replaceAsync(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)CompletableFuture<Boolean>replaceWithVersionAsync(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)-
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheImpl
addClientListener, addClientListener, assertRemoteCacheManagerIsStarted, clearAsync, clientStatistics, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, entryIterator, entrySet, execute, execute, getAllAsync, getCacheTopologyInfo, getDataFormat, getListeners, getName, getOperationsFactory, getProtocolVersion, getRemoteCacheManager, getVersion, hasForceReturnFlag, init, init, isEmpty, isObjectStorage, keyAsObjectIfNeeded, keyIterator, keySet, keyToBytes, mergeAsync, ping, publishEntries, publishEntriesByQuery, publishEntriesWithMetadata, removeClientListener, replaceAll, resolveStorage, retrieveEntries, retrieveEntriesByQuery, retrieveEntriesWithMetadata, serverStatistics, sizeAsync, start, stop, streaming, values, valueToBytes, 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, getAll, getWithMetadata, keySet, putAll, putAll, putAll, putAllAsync, putAllAsync, remove, remove, removeWithVersion, replace, replace, replace, replaceWithVersion, replaceWithVersion, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, replaceWithVersionAsync, retrieveEntries, retrieveEntries, stats, values
-
-
-
-
Constructor Detail
-
TransactionalRemoteCacheImpl
public TransactionalRemoteCacheImpl(RemoteCacheManager rcm, String name, boolean forceReturnValue, boolean recoveryEnabled, TransactionManager transactionManager, TransactionTable transactionTable, org.infinispan.commons.time.TimeService timeService)
-
-
Method Detail
-
removeWithVersionAsync
public CompletableFuture<Boolean> removeWithVersionAsync(K key, long version)
- Specified by:
removeWithVersionAsyncin interfaceRemoteCache<K,V>- Overrides:
removeWithVersionAsyncin classRemoteCacheImpl<K,V>- See Also:
RemoteCache.remove(Object, Object)
-
replaceWithVersionAsync
public CompletableFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
- Specified by:
replaceWithVersionAsyncin interfaceRemoteCache<K,V>- Overrides:
replaceWithVersionAsyncin classRemoteCacheImpl<K,V>- See Also:
RemoteCache.replaceWithVersion(Object, Object, long)
-
getWithMetadataAsync
public CompletableFuture<MetadataValue<V>> getWithMetadataAsync(K key)
Description copied from interface:RemoteCacheAsynchronously returns theMetadataValueassociated to the supplied key param, or null if it doesn't exist.- Specified by:
getWithMetadataAsyncin interfaceRemoteCache<K,V>- Overrides:
getWithMetadataAsyncin classRemoteCacheImpl<K,V>
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:RemoteCacheAdds or overrides each specified entry in the remote cache. This operation provides better performance than calling put() for each entry.- Specified by:
putAllAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Specified by:
putAllAsyncin interfaceRemoteCache<K,V>- Overrides:
putAllAsyncin classRemoteCacheImpl<K,V>- See Also:
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAsync
public CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
- Specified by:
putIfAbsentAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Overrides:
putIfAbsentAsyncin classRemoteCacheImpl<K,V>
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
- Specified by:
replaceAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Overrides:
replaceAsyncin classRemoteCacheImpl<K,V>
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
- Specified by:
replaceAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Overrides:
replaceAsyncin classRemoteCacheImpl<K,V>
-
containsKeyAsync
public CompletableFuture<Boolean> containsKeyAsync(K key)
- Specified by:
containsKeyAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Overrides:
containsKeyAsyncin classRemoteCacheImpl<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>- Overrides:
containsValuein classRemoteCacheImpl<K,V>
-
getAsync
public CompletableFuture<V> getAsync(Object key)
-
removeAsync
public CompletableFuture<V> removeAsync(Object key)
- Specified by:
removeAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Overrides:
removeAsyncin classRemoteCacheImpl<K,V>
-
removeAsync
public CompletableFuture<Boolean> removeAsync(Object key, Object value)
- Specified by:
removeAsyncin interfaceorg.infinispan.commons.api.AsyncCache<K,V>- Overrides:
removeAsyncin classRemoteCacheImpl<K,V>
-
getTransactionManager
public TransactionManager getTransactionManager()
-
isTransactional
public boolean isTransactional()
- Specified by:
isTransactionalin interfaceRemoteCache<K,V>- Overrides:
isTransactionalin classRemoteCacheImpl<K,V>- Returns:
trueif the cache can participate in a transaction,falseotherwise.
-
-