Package org.infinispan.api.reactive
Interface KeyValueStore<K,V>
-
@Experimental public interface KeyValueStore<K,V>
A Reactive Key Value Store provides a highly concurrent and distributed data structure, non blocking and using reactive streams.- Since:
- 10.0
- Author:
- Katia Aresti, karesti@redhat.com
- See Also:
- Infinispan documentation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<Void>clear()Clear the store.CompletionStage<Void>delete(K key)Delete the keyorg.reactivestreams.Publisher<? extends Map.Entry<K,V>>entries()Retrieve all entriesCompletionStage<Long>estimateSize()Estimate the size of the storeorg.reactivestreams.Publisher<KeyValueEntry<K,V>>find(String ickleQuery)Executes the query and returns a reactive streams Publisher with the resultsorg.reactivestreams.Publisher<KeyValueEntry<K,V>>find(QueryRequest queryRequest)Find by QueryRequest.org.reactivestreams.Publisher<KeyValueEntry<K,V>>findContinuously(String ickleQuery)Executes the query and returns a reactive streams Publisher with the results<T> org.reactivestreams.Publisher<KeyValueEntry<K,T>>findContinuously(QueryRequest queryRequest)Executes the query and returns a reactive streams Publisher with the resultsCompletionStage<V>get(K key)Get the value of the Key if such existsCompletionStage<Boolean>insert(K key, V value)Insert the key/value if such key does not existorg.reactivestreams.Publisher<K>keys()Retrieve all keysorg.reactivestreams.Publisher<KeyValueEntry<K,V>>listen(KeyValueStoreListener listener)Listens to theKeyValueStoreListenerCompletionStage<Void>save(K key, V value)Save the key/value.org.reactivestreams.Publisher<WriteResult<K>>saveMany(org.reactivestreams.Publisher<Map.Entry<K,V>> pairs)Save many from a Publisher
-
-
-
Method Detail
-
get
CompletionStage<V> get(K key)
Get the value of the Key if such exists- Parameters:
key-- Returns:
- the value
-
insert
CompletionStage<Boolean> insert(K key, V value)
Insert the key/value if such key does not exist- Parameters:
key-value-- Returns:
- Void
-
save
CompletionStage<Void> save(K key, V value)
Save the key/value. If the key exists will replace the value- Parameters:
key-value-- Returns:
- Void
-
delete
CompletionStage<Void> delete(K key)
Delete the key- Parameters:
key-- Returns:
- Void
-
keys
org.reactivestreams.Publisher<K> keys()
Retrieve all keys- Returns:
- Publisher
-
entries
org.reactivestreams.Publisher<? extends Map.Entry<K,V>> entries()
Retrieve all entries- Returns:
-
saveMany
org.reactivestreams.Publisher<WriteResult<K>> saveMany(org.reactivestreams.Publisher<Map.Entry<K,V>> pairs)
Save many from a Publisher- Parameters:
pairs-- Returns:
- Void
-
estimateSize
CompletionStage<Long> estimateSize()
Estimate the size of the store- Returns:
- Long, estimated size
-
clear
CompletionStage<Void> clear()
Clear the store. If a concurrent operation puts data in the store the clear might not properly work- Returns:
- Void
-
find
org.reactivestreams.Publisher<KeyValueEntry<K,V>> find(String ickleQuery)
Executes the query and returns a reactive streams Publisher with the results- Parameters:
ickleQuery- query String- Returns:
- Publisher reactive streams
-
find
org.reactivestreams.Publisher<KeyValueEntry<K,V>> find(QueryRequest queryRequest)
Find by QueryRequest.- Parameters:
queryRequest-- Returns:
-
findContinuously
org.reactivestreams.Publisher<KeyValueEntry<K,V>> findContinuously(String ickleQuery)
Executes the query and returns a reactive streams Publisher with the results- Parameters:
ickleQuery- query String- Returns:
- Publisher reactive streams
-
findContinuously
<T> org.reactivestreams.Publisher<KeyValueEntry<K,T>> findContinuously(QueryRequest queryRequest)
Executes the query and returns a reactive streams Publisher with the results- Parameters:
queryRequest-- Returns:
- Publisher reactive streams
-
listen
org.reactivestreams.Publisher<KeyValueEntry<K,V>> listen(KeyValueStoreListener listener)
Listens to theKeyValueStoreListener- Parameters:
listener-- Returns:
- Publisher reactive streams
-
-