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 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

      CompletableFuture<V> loadAsync(K key)
      Load a single key.
      Parameters:
      key - The key.
      Returns:
      The future.
    • loadAllAsync

      CompletableFuture<Map<K,V>> loadAllAsync(Iterable<? extends K> keys)
      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

      CompletableFuture<Void> deleteAsync(CacheStoreSession session, K key)
      Delete a key from the store.
      Parameters:
      session - The session.
      key - The key.
    • deleteAllAsync

      CompletableFuture<Void> deleteAllAsync(CacheStoreSession session, Collection<? extends K> keys)
      Delete a batch from the store.
      Parameters:
      session - The session.
      keys - Keys.
      Returns:
      The future.
    • loadCacheAsync

      CompletableFuture<Void> loadCacheAsync(BiConsumer<K,V> clo, @Nullable @Nullable Object... args)
      Load a cache.
      Parameters:
      clo - The closure called on each loaded entry.
      args - Optional args.
      Returns:
      The future.