Package org.infinispan.multimap.impl
Class EmbeddedMultimapCache<K,V>
java.lang.Object
org.infinispan.multimap.impl.EmbeddedMultimapCache<K,V>
- All Implemented Interfaces:
org.infinispan.multimap.api.BasicMultimapCache<K,,V> MultimapCache<K,V>
Embedded implementation of
MultimapCache
Transactions
EmbeddedMultimapCache supports implicit transactions without blocking. The following methods block when they are called in a explicit transaction context. This limitation could be improved in the following versions if technically possible :BasicMultimapCache.size()BasicMultimapCache.containsEntry(Object, Object)
Duplicates
MultimapCache can optionally support duplicate values on keys. {@link <pre> multimapCache.put("k", "v1").join(); multimapCache.put("k", "v2").join(); multimapCache.put("k", "v2").join(); multimapCache.put("k", "v2").join(); multimapCache.get("k").thenAccept(values -> System.out.println(values.size())); // prints the value 4. "k" -> ["v1", "v2", "v2", "v2"]- Since:
- 9.2
- Author:
- Katia Aresti, karesti@redhat.com
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedMultimapCache(org.infinispan.Cache<K, Bucket<V>> cache, boolean supportsDuplicates) -
Method Summary
Modifier and TypeMethodDescriptioncontainsEntry(K key, V value) containsKey(K key) containsValue(V value) getCache()CompletableFuture<Optional<org.infinispan.container.entries.CacheEntry<K,Collection<V>>>> Retrieves a CacheEntry corresponding to a specific key in this multimap cache.Asynchronous method.size()booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.multimap.api.embedded.MultimapCache
remove
-
Constructor Details
-
EmbeddedMultimapCache
-
-
Method Details
-
put
-
get
-
getEntry
public CompletableFuture<Optional<org.infinispan.container.entries.CacheEntry<K,Collection<V>>>> getEntry(K key) Description copied from interface:MultimapCacheRetrieves a CacheEntry corresponding to a specific key in this multimap cache.- Specified by:
getEntryin interfaceMultimapCache<K,V> - Parameters:
key- the key whose associated cache entry is to be returned- Returns:
- the cache entry to which the specified key is mapped, or
Optional.empty()if this multimap contains no mapping for the key
-
remove
-
remove
-
remove
Description copied from interface:MultimapCacheAsynchronous method. Removes every value that match thePredicate.This method is blocking used in a explicit transaction context.
- Specified by:
removein interfaceMultimapCache<K,V> - Parameters:
p- the predicate to be tested on every value in this multimap cache- Returns:
CompletableFuturecontaining aVoid
-
containsKey
-
containsValue
-
containsEntry
-
size
-
supportsDuplicates
public boolean supportsDuplicates() -
getCache
-