Class S4LruPolicy

  • All Implemented Interfaces:
    Policy, Policy.KeyOnlyPolicy

    public final class S4LruPolicy
    extends Object
    implements Policy.KeyOnlyPolicy
    "Quadruply-segmented LRU. Four queues are maintained at levels 0 to 3. On a cache miss, the item is inserted at the head of queue 0. On a cache hit, the item is moved to the head of the next higher queue (items in queue 3 move to the head of queue 3). Each queue is allocated 1/4 of the total cache size and items are evicted from the tail of a queue to the head of the next lower queue to maintain the size invariants. Items evicted from queue 0 are evicted from the cache." For more details, see An Analysis of Facebook Photo Caching.
    • Constructor Detail

    • Method Detail

      • policies

        public static Set<Policy> policies​(Config config)
        Returns all variations of this policy based on the configuration parameters.
      • finished

        public void finished()
        Description copied from interface: Policy
        Indicates that the recording has completed.
        Specified by:
        finished in interface Policy
      • stats

        public PolicyStats stats()
        Description copied from interface: Policy
        Returns the cache efficiency statistics.
        Specified by:
        stats in interface Policy