Class LruCache

java.lang.Object
org.minidns.DnsCache
org.minidns.cache.LruCache
Direct Known Subclasses:
ExtendedLruCache

public class LruCache extends DnsCache
LRU based DNSCache backed by a LinkedHashMap.
  • Field Details

    • 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.
    • backend

      The backend cache.
  • Constructor Details

    • LruCache

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

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

      public LruCache()
  • Method Details