Package org.apache.ignite.cache
Interface CacheStore<K,V>
- Type Parameters:
K
- Mapped key type.V
- Mapped value type.
public interface CacheStore<K,V>
Interface for a generic store which contents is cached by GridGain cache.
-
Method Summary
Modifier and TypeMethodDescriptionBegin a store session.deleteAllAsync
(CacheStoreSession session, Collection<? extends K> keys) Delete a batch from the store.deleteAsync
(CacheStoreSession session, K key) Delete a key from the store.loadAllAsync
(Iterable<? extends K> keys) Load a batch.Load a single key.loadCacheAsync
(BiConsumer<K, V> clo, @Nullable Object... args) Load a cache.writeAllAsync
(CacheStoreSession session, Collection<Map.Entry<? extends K, ? extends V>> entries) Write a batch to the store.writeAsync
(CacheStoreSession session, Map.Entry<? extends K, ? extends V> entry) Write a single entry to the store.
-
Method Details
-
beginSession
CacheStoreSession beginSession()Begin a store session.The session is the equivalent of a transaction for a cache.
The same session can be reused between multiple compatible stores, enlisting them in a cross-store transaction.
Some implementations might choose not to support sessions. In this case there is no consistency guarantee between cache and store on write failure.
- Returns:
- The session.
- See Also:
-
loadAsync
Load a single key.- Parameters:
key
- The key.- Returns:
- The future.
-
loadAllAsync
Load a batch.- Parameters:
keys
- Keys.- Returns:
- The future.
-
writeAsync
CompletableFuture<Void> writeAsync(CacheStoreSession session, Map.Entry<? extends K, ? extends V> entry) Write a single entry to the store.- Parameters:
session
- The session.entry
- The entry.- Returns:
- The future.
-
writeAllAsync
CompletableFuture<Void> writeAllAsync(CacheStoreSession session, Collection<Map.Entry<? extends K, ? extends V>> entries) Write a batch to the store.- Parameters:
session
- The session.entries
- Entries.- Returns:
- The future.
-
deleteAsync
Delete a key from the store.- Parameters:
session
- The session.key
- The key.
-
deleteAllAsync
Delete a batch from the store.- Parameters:
session
- The session.keys
- Keys.- Returns:
- The future.
-
loadCacheAsync
Load a cache.- Parameters:
clo
- The closure called on each loaded entry.args
- Optional args.- Returns:
- The future.
-