Package org.infinispan.api.mutiny
Interface MutinyCache<K,V>
A Reactive Cache provides a highly concurrent and distributed data structure, non blocking and using reactive
streams.
- Since:
- 14.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.smallrye.mutiny.Uni<Void> clear()Clear the store.io.smallrye.mutiny.Uni<Void> clear(CacheOptions options) Clear the store.io.smallrye.mutiny.Uni<CacheConfiguration> The configuration for this cache.Return the container of this cachedefault io.smallrye.mutiny.Multi<CacheEntry<K, V>> entries()Retrieve all entriesio.smallrye.mutiny.Multi<CacheEntry<K, V>> entries(CacheOptions options) Retrieve all entriesdefault io.smallrye.mutiny.Uni<Long> Estimate the size of the storeio.smallrye.mutiny.Uni<Long> estimateSize(CacheOptions options) Estimate the size of the storedefault io.smallrye.mutiny.Uni<V> Get the value of the Key if such existsdefault io.smallrye.mutiny.Uni<V> get(K key, CacheOptions options) Get the value of the Key if such existsdefault io.smallrye.mutiny.Multi<CacheEntry<K, V>> Retrieve all the entries for the specified keys.io.smallrye.mutiny.Multi<CacheEntry<K, V>> getAll(Set<K> keys, CacheOptions options) Retrieve all the entries for the specified keys.default io.smallrye.mutiny.Multi<CacheEntry<K, V>> io.smallrye.mutiny.Multi<CacheEntry<K, V>> getAll(CacheOptions options, K... keys) default io.smallrye.mutiny.Uni<CacheEntry<K, V>> getAndRemove(K key) Removes the key and returns its value if present.io.smallrye.mutiny.Uni<CacheEntry<K, V>> getAndRemove(K key, CacheOptions options) Removes the key and returns its value if present.default io.smallrye.mutiny.Multi<CacheEntry<K, V>> getAndRemoveAll(io.smallrye.mutiny.Multi<K> keys) Removes a set of keys.default io.smallrye.mutiny.Multi<CacheEntry<K, V>> getAndRemoveAll(io.smallrye.mutiny.Multi<K> keys, CacheWriteOptions options) Removes a set of keys.default io.smallrye.mutiny.Uni<CacheEntry<K, V>> io.smallrye.mutiny.Uni<CacheEntry<K, V>> getEntry(K key, CacheOptions options) default io.smallrye.mutiny.Uni<CacheEntry<K, V>> getOrReplaceEntry(K key, V value, CacheEntryVersion version) io.smallrye.mutiny.Uni<CacheEntry<K, V>> getOrReplaceEntry(K key, V value, CacheEntryVersion version, CacheWriteOptions options) default io.smallrye.mutiny.Multi<K> keys()Retrieve all keysdefault io.smallrye.mutiny.Multi<K> keys(CacheOptions options) Retrieve all keysdefault io.smallrye.mutiny.Multi<CacheEntryEvent<K, V>> listen(CacheEntryEventType... types) Listens to the eventsio.smallrye.mutiny.Multi<CacheEntryEvent<K, V>> listen(CacheListenerOptions options, CacheEntryEventType... types) Listens to the eventsname()The name of the cache.default <T> io.smallrye.mutiny.Multi<CacheEntryProcessorResult<K, T>> Process the specified entries using the supplied processor<T> io.smallrye.mutiny.Multi<CacheEntryProcessorResult<K, T>> process(Set<K> keys, MutinyCacheEntryProcessor<K, V, T> processor, CacheOptions options) Process the specified entries using the supplied processordefault io.smallrye.mutiny.Uni<CacheEntry<K, V>> Save the key/value.io.smallrye.mutiny.Uni<CacheEntry<K, V>> put(K key, V value, CacheWriteOptions options) default io.smallrye.mutiny.Uni<Void> putAll(io.smallrye.mutiny.Multi<CacheEntry<K, V>> pairs) Put multiple entries from aMultiio.smallrye.mutiny.Uni<Void> putAll(io.smallrye.mutiny.Multi<CacheEntry<K, V>> pairs, CacheWriteOptions options) default io.smallrye.mutiny.Uni<Void> io.smallrye.mutiny.Uni<Void> putAll(Map<K, V> map, CacheWriteOptions options) default io.smallrye.mutiny.Uni<CacheEntry<K, V>> putIfAbsent(K key, V value) Insert the key/value if such key does not existio.smallrye.mutiny.Uni<CacheEntry<K, V>> putIfAbsent(K key, V value, CacheWriteOptions options) default <R> MutinyQuery<K, V, R> Find by QueryRequest.<R> MutinyQuery<K, V, R> query(String query, CacheOptions options) Find by QueryRequest.default io.smallrye.mutiny.Uni<Boolean> Delete the keydefault io.smallrye.mutiny.Uni<Boolean> remove(K key, CacheOptions options) Delete the keydefault io.smallrye.mutiny.Multi<K> Removes a set of keys.io.smallrye.mutiny.Multi<K> removeAll(io.smallrye.mutiny.Multi<K> keys, CacheWriteOptions options) Removes a set of keys.default io.smallrye.mutiny.Multi<K> Removes a set of keys.io.smallrye.mutiny.Multi<K> removeAll(Set<K> keys, CacheWriteOptions options) Removes a set of keys.default io.smallrye.mutiny.Uni<Boolean> replace(K key, V value, CacheEntryVersion version) default io.smallrye.mutiny.Uni<Boolean> replace(K key, V value, CacheEntryVersion version, CacheWriteOptions options) default io.smallrye.mutiny.Uni<Void> default io.smallrye.mutiny.Uni<Void> set(K key, V value, CacheWriteOptions options) default io.smallrye.mutiny.Uni<Boolean> setIfAbsent(K key, V value) Insert the key/value if such key does not existdefault io.smallrye.mutiny.Uni<Boolean> setIfAbsent(K key, V value, CacheWriteOptions options)
-
Method Details
-
name
String name()The name of the cache.- Returns:
-
configuration
io.smallrye.mutiny.Uni<CacheConfiguration> configuration()The configuration for this cache.- Returns:
-
container
MutinyContainer container()Return the container of this cache- Returns:
-
get
Get the value of the Key if such exists- Parameters:
key-- Returns:
- the value
-
get
Get the value of the Key if such exists- Parameters:
key-options-- Returns:
- the value
-
getEntry
- Parameters:
key-- Returns:
-
getEntry
- Parameters:
key-options-- Returns:
-
putIfAbsent
Insert the key/value if such key does not exist- Parameters:
key-value-- Returns:
- the previous value if present
-
putIfAbsent
- Parameters:
key-value-options-- Returns:
- the previous value if present
-
setIfAbsent
Insert the key/value if such key does not exist- Parameters:
key-value-- Returns:
-
setIfAbsent
- Parameters:
key-value-options-- Returns:
-
put
Save the key/value. If the key exists will replace the value- Parameters:
key-value-- Returns:
-
put
- Parameters:
key-value-options-- Returns:
-
set
- Parameters:
key-value-- Returns:
-
set
- Parameters:
key-value-options-- Returns:
-
remove
Delete the key- Parameters:
key-- Returns:
- true if the key existed and was removed, false if the key did not exist.
-
remove
Delete the key- Parameters:
key-options-- Returns:
- true if the key existed and was removed, false if the key did not exist.
-
getAndRemove
Removes the key and returns its value if present.- Parameters:
key-- Returns:
- the value of the key before removal. Returns null if the key didn't exist.
-
getAndRemove
Removes the key and returns its value if present.- Parameters:
key-options-- Returns:
- the value of the key before removal. Returns null if the key didn't exist.
-
keys
Retrieve all keys- Returns:
- @
Multiwhich produces keys as items.
-
keys
Retrieve all keys- Returns:
- @
Multiwhich produces keys as items.
-
entries
Retrieve all entries- Returns:
-
entries
Retrieve all entries- Parameters:
options-- Returns:
-
getAll
Retrieve all the entries for the specified keys.- Parameters:
keys-- Returns:
-
getAll
Retrieve all the entries for the specified keys.- Parameters:
keys-options-- Returns:
-
getAll
- Parameters:
keys-- Returns:
-
getAll
- Parameters:
options-keys-- Returns:
-
putAll
Put multiple entries from aMulti- Parameters:
pairs-- Returns:
- Void
-
putAll
io.smallrye.mutiny.Uni<Void> putAll(io.smallrye.mutiny.Multi<CacheEntry<K, V>> pairs, CacheWriteOptions options) - Parameters:
pairs-options-- Returns:
-
putAll
- Parameters:
map-options-- Returns:
-
putAll
-
replace
- Parameters:
key-value-- Returns:
-
replace
default io.smallrye.mutiny.Uni<Boolean> replace(K key, V value, CacheEntryVersion version, CacheWriteOptions options) - Parameters:
key-value-options-- Returns:
-
getOrReplaceEntry
default io.smallrye.mutiny.Uni<CacheEntry<K,V>> getOrReplaceEntry(K key, V value, CacheEntryVersion version) - Parameters:
key-value-version-- Returns:
-
getOrReplaceEntry
io.smallrye.mutiny.Uni<CacheEntry<K,V>> getOrReplaceEntry(K key, V value, CacheEntryVersion version, CacheWriteOptions options) - Parameters:
key-value-version-options-- Returns:
-
removeAll
Removes a set of keys. Returns the keys that were removed.- Parameters:
keys-- Returns:
-
removeAll
Removes a set of keys. Returns the keys that were removed.- Parameters:
keys-options-- Returns:
-
removeAll
Removes a set of keys. Returns the keys that were removed.- Parameters:
keys-- Returns:
-
removeAll
Removes a set of keys. Returns the keys that were removed.- Parameters:
keys-options-- Returns:
-
getAndRemoveAll
Removes a set of keys. Returns the keys that were removed.- Parameters:
keys-- Returns:
-
getAndRemoveAll
default io.smallrye.mutiny.Multi<CacheEntry<K,V>> getAndRemoveAll(io.smallrye.mutiny.Multi<K> keys, CacheWriteOptions options) Removes a set of keys. Returns the keys that were removed.- Parameters:
keys-options-- Returns:
-
estimateSize
Estimate the size of the store- Returns:
- Long, estimated size
-
estimateSize
Estimate the size of the store- Parameters:
options-- Returns:
- Long, estimated size
-
clear
Clear the store. If a concurrent operation puts data in the store the clear might not properly work- Returns:
- Void
-
clear
Clear the store. If a concurrent operation puts data in the store the clear might not properly work- Parameters:
options-- Returns:
- Void
-
query
Find by QueryRequest.- Type Parameters:
R-- Parameters:
query-- Returns:
-
query
Find by QueryRequest.- Type Parameters:
R-- Parameters:
query-options-- Returns:
-
listen
Listens to the events- Parameters:
types-- Returns:
- a
Multiwhich producesCacheEntryEventitems.
-
listen
io.smallrye.mutiny.Multi<CacheEntryEvent<K,V>> listen(CacheListenerOptions options, CacheEntryEventType... types) Listens to the events- Parameters:
options-types-- Returns:
- a
Multiwhich producesCacheEntryEventitems.
-
process
default <T> io.smallrye.mutiny.Multi<CacheEntryProcessorResult<K,T>> process(Set<K> keys, MutinyCacheEntryProcessor<K, V, T> processor) Process the specified entries using the supplied processor- Parameters:
keys-processor-
-
process
<T> io.smallrye.mutiny.Multi<CacheEntryProcessorResult<K,T>> process(Set<K> keys, MutinyCacheEntryProcessor<K, V, T> processor, CacheOptions options) Process the specified entries using the supplied processor- Parameters:
keys-processor-options-
-
streaming
MutinyStreamingCache<K> streaming()- Returns:
-