Class StoreCache<T>

java.lang.Object
org.gridgain.internal.rbac.store.StoreCache<T>
Type Parameters:
T - Type of cached entry.

public final class StoreCache<T> extends Object
Thread-safe volatile cache for Store read operations.

Maintains a volatile map that can be atomically replaced via update(org.apache.ignite.configuration.NamedListView<V>, java.util.function.Function<V, T>). Read operations are lock-free.

  • Constructor Details

    • StoreCache

      public StoreCache()
  • Method Details

    • update

      public <V> void update(@Nullable @Nullable org.apache.ignite.configuration.NamedListView<V> list, Function<V,T> converter)
      Rebuilds the cache from a NamedListView.

      Keys are taken from NamedListView.namedListKeys() (the storage key passed to create/put), not from displayName which may differ.

      Type Parameters:
      V - View entry type.
      Parameters:
      list - Named list view, or null for an empty cache.
      converter - Converts a view entry to a cached value.
    • getAll

      public Collection<T> getAll()
      Returns all cached values.
    • getAllWithKeys

      public Map<LowerCaseString,T> getAllWithKeys()
      Returns the full cache map.
    • get

      @Nullable public T get(LowerCaseString key)
      Returns cached value by key, or null if not found.
    • get

      public List<T> get(Collection<LowerCaseString> keys)
      Returns cached values by keys; null entries for missing keys.