Interface RLocalCachedMap<K,V>

Type Parameters:
K - map key
V - map value
All Superinterfaces:
ConcurrentMap<K,V>, Map<K,V>, RDestroyable, RExpirable, RExpirableAsync, RMap<K,V>, RMapAsync<K,V>, RObject, RObjectAsync
All Known Implementing Classes:
RedissonLocalCachedMap, RedissonTransactionalLocalCachedMap

public interface RLocalCachedMap<K,V> extends RMap<K,V>
Map object with local entry cache support.

Each instance maintains local cache to achieve fast read operations. Suitable for maps which used mostly for read operations and network roundtrip delays are undesirable.

Author:
Nikita Koksharov
  • Method Details

    • preloadCache

      void preloadCache()
      Pre-warm the cached entries. Not guaranteed to load ALL values, but statistically will preload approximately all (all if no concurrent mutating activity). Entries are loaded in a batch with size of 10 elements.
    • preloadCache

      void preloadCache(int count)
      Pre-warm the cached entries. Not guaranteed to load ALL values, but statistically will preload approximately all (all if no concurrent mutating activity) Entries are loaded in a batch. Batch size is defined by count param.
      Parameters:
      count - - size of batch
    • clearLocalCacheAsync

      RFuture<Void> clearLocalCacheAsync()
      Clears local cache across all instances
      Returns:
      void
    • clearLocalCache

      void clearLocalCache()
      Clears local cache across all instances
    • cachedKeySet

      Set<K> cachedKeySet()
      Returns all keys stored in local cache
      Returns:
      keys
    • cachedValues

      Collection<V> cachedValues()
      Returns all values stored in local cache
      Returns:
      values
    • cachedEntrySet

      Set<Map.Entry<K,V>> cachedEntrySet()
      Returns all map entries stored in local cache
      Returns:
      entries
    • getCachedMap

      Map<K,V> getCachedMap()
      Returns state of local cache
      Returns:
      map
    • addListener

      int addListener(ObjectListener listener)
      Adds local cache event listener
      Specified by:
      addListener in interface RMap<K,V>
      Specified by:
      addListener in interface RObject
      Parameters:
      listener - - local cache event listener
      Returns:
      listener id
      See Also: