Class LruCache

    • Field Detail

      • missCount

        protected long missCount
        Internal miss count.
      • expireCount

        protected long expireCount
        Internal expire count (subset of misses that was caused by expire).
      • hitCount

        protected long hitCount
        Internal hit count.
      • capacity

        protected int capacity
        The internal capacity of the backend cache.
      • maxTTL

        protected long maxTTL
        The upper bound of the ttl. All longer TTLs will be capped by this ttl.
    • Constructor Detail

      • LruCache

        public LruCache​(int capacity,
                        long maxTTL)
        Create a new LRUCache with given capacity and upper bound ttl.
        capacity - The internal capacity.
        maxTTL - The upper bound for any ttl.
      • LruCache

        public LruCache​(int capacity)
        Create a new LRUCache with given capacity.
        capacity - The capacity of this cache.