Class LruBoundedCache<K,​V>

  • Direct Known Subclasses:
    ActorRefResolveCache, ActorRefResolveCacheWithAddress, SerializationFormatCache

    public abstract class LruBoundedCache<K,​V>
    extends java.lang.Object

    This class is based on a Robin-Hood hashmap ( with backshift (

    The main modification compared to an RH hashmap is that it never grows the map (no rehashes) instead it is allowed to kick out entires that are considered old. The implementation tries to keep the map close to full, only evicting old entries when needed.

    • Constructor Detail

      • LruBoundedCache

        public LruBoundedCache​(int capacity,
                               int evictAgeThreshold,
                               scala.reflect.ClassTag<K> evidence$1,
                               scala.reflect.ClassTag<V> evidence$2)
    • Method Detail

      • compute

        protected abstract V compute​(K k)
      • get

        public final scala.Option<V> get​(K k)
      • getOrCompute

        public final V getOrCompute​(K k)
      • hash

        protected abstract int hash​(K k)
      • isCacheable

        protected abstract boolean isCacheable​(V v)
      • probeDistanceOf

        protected int probeDistanceOf​(int idealSlot,
                                      int actualSlot)
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object