org.apache.solr.util

Class ConcurrentLRUCache<K,V>

  • All Implemented Interfaces:
    Accountable, Cache<K,V>


    public class ConcurrentLRUCache<K,V>
    extends Object
    implements Cache<K,V>, Accountable
    A LRU cache implementation based upon ConcurrentHashMap and other techniques to reduce contention and synchronization overhead to utilize multiple CPU cores more effectively.

    Note that the implementation does not follow a true LRU (least-recently-used) eviction strategy. Instead it strives to remove least recently used items but when the initial cleanup does not remove enough items to reach the 'acceptableWaterMark' limit, it can remove more items forcefully regardless of access order.

    Since:
    solr 1.4