Class RemoteMultimapCacheImpl<K,V>
java.lang.Object
org.infinispan.client.hotrod.impl.multimap.RemoteMultimapCacheImpl<K,V>
- All Implemented Interfaces:
RemoteMultimapCache<K,,V> BasicMultimapCache<K,V>
Remote implementation of
RemoteMultimapCache- Since:
- 9.2
- Author:
- karesti@redhat.com
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteMultimapCacheImpl(RemoteCacheManager rcm, RemoteCache<K, Collection<V>> cache) RemoteMultimapCacheImpl(RemoteCacheManager rcm, RemoteCache<K, Collection<V>> cache, boolean supportsDuplicates) -
Method Summary
Modifier and TypeMethodDescriptioncontainsEntry(K key, V value) ReturnsBoolean.TRUEif this multimap cache contains the key-value pair.containsKey(K key) ReturnsBoolean.TRUEif this multimap cache contains the key.containsValue(V value) Asynchronous method that returnsBoolean.TRUEif this multimap cache contains the value at any key.Returns a view collection of the values associated with key in this multimap cache, if any.getWithMetadata(K key) Returns aMetadataCollection<V>of the values associated with key in this multimap cache, if any.voidinit()Puts a key-value pair in this multimap cache.Removes all the key-value pairs associated with the key from this multimap cache, if such exists.Removes a key-value pair from this multimap cache, if such exists.size()Returns the number of key-value pairs in this multimap cache.booleanMultimap can support duplicates on the same key k → ['a', 'a', 'b'] or not k → ['a', 'b'] depending on configuration.
-
Constructor Details
-
RemoteMultimapCacheImpl
-
RemoteMultimapCacheImpl
public RemoteMultimapCacheImpl(RemoteCacheManager rcm, RemoteCache<K, Collection<V>> cache, boolean supportsDuplicates)
-
-
Method Details
-
init
public void init() -
put
Description copied from interface:BasicMultimapCachePuts a key-value pair in this multimap cache.- If this multimap cache supports duplicates, the value will be always added.
- If this multimap cache does not support duplicates and the value exists on the key, nothing will be done.
- Specified by:
putin interfaceBasicMultimapCache<K,V> - Parameters:
key- the key to be putvalue- the value to added- Returns:
CompletableFuturecontaining aVoid
-
get
Description copied from interface:BasicMultimapCacheReturns a view collection of the values associated with key in this multimap cache, if any. Any changes to the retrieved collection won't change the values in this multimap cache. When this method returns an empty collection, it means the key was not found.- Specified by:
getin interfaceBasicMultimapCache<K,V> - Parameters:
key- to be retrieved- Returns:
- a
CompletableFuturecontainingwhich is a view of the underlying values.
-
getWithMetadata
Description copied from interface:RemoteMultimapCacheReturns aMetadataCollection<V>of the values associated with key in this multimap cache, if any. Any changes to the retrieved collection won't change the values in this multimap cache. When this method returns an empty metadata collection, it means the key was not found.- Specified by:
getWithMetadatain interfaceRemoteMultimapCache<K,V> - Parameters:
key- to be retrieved- Returns:
- the collection with the metadata of the given key
-
remove
Description copied from interface:BasicMultimapCacheRemoves all the key-value pairs associated with the key from this multimap cache, if such exists.- Specified by:
removein interfaceBasicMultimapCache<K,V> - Parameters:
key- to be removed- Returns:
- a
CompletableFuturecontainingBoolean.TRUEif the entry was removed, andBoolean.FALSEwhen the entry was not removed
-
remove
Description copied from interface:BasicMultimapCacheRemoves a key-value pair from this multimap cache, if such exists. Returns true when the key-value pair has been removed from the key.- In the case where duplicates are not supported, only one the key-value pair will be removed, if such exists.
- In the case where duplicates are supported, all the key-value pairs will be removed.
- If the values remaining after the remove call are empty, the whole entry will be removed.
- Specified by:
removein interfaceBasicMultimapCache<K,V> - Parameters:
key- key to be removedvalue- value to be removed- Returns:
CompletableFuturecontainingBoolean.TRUEif the key-value pair was removed, andBoolean.FALSEwhen the key-value pair was not removed
-
containsKey
Description copied from interface:BasicMultimapCacheReturnsBoolean.TRUEif this multimap cache contains the key.- Specified by:
containsKeyin interfaceBasicMultimapCache<K,V> - Parameters:
key- the key that might exists in this multimap cache- Returns:
CompletableFuturecontaining aBoolean
-
containsValue
Description copied from interface:BasicMultimapCacheAsynchronous method that returnsBoolean.TRUEif this multimap cache contains the value at any key.- Specified by:
containsValuein interfaceBasicMultimapCache<K,V> - Parameters:
value- the value that might exists in any entry- Returns:
CompletableFuturecontaining aBoolean
-
containsEntry
Description copied from interface:BasicMultimapCacheReturnsBoolean.TRUEif this multimap cache contains the key-value pair.- Specified by:
containsEntryin interfaceBasicMultimapCache<K,V> - Parameters:
key- the key of the key-value pairvalue- the value of the key-value pair- Returns:
CompletableFuturecontaining aBoolean
-
size
Description copied from interface:BasicMultimapCacheReturns the number of key-value pairs in this multimap cache. It doesn't return the distinct number of keys.This method is blocking in a explicit transaction context.
The
CompletableFutureis a- Specified by:
sizein interfaceBasicMultimapCache<K,V> - Returns:
CompletableFuturecontaining the size asLong
-
supportsDuplicates
public boolean supportsDuplicates()Description copied from interface:BasicMultimapCacheMultimap can support duplicates on the same key k → ['a', 'a', 'b'] or not k → ['a', 'b'] depending on configuration.Returns duplicates are supported or not in this multimap cache.
- Specified by:
supportsDuplicatesin interfaceBasicMultimapCache<K,V> - Returns:
trueif this multimap supports duplicate values for a given key.
-