Class CarPolicy

  • All Implemented Interfaces:
    Policy, Policy.KeyOnlyPolicy

    public final class CarPolicy
    extends Object
    implements Policy.KeyOnlyPolicy
    Clock with Adaptive Replacement policy. This algorithm differs from ARC by replacing the LRU policy with the Clock (Second Chance) policy. This allows cache hits to be performed concurrently at the cost of a global lock on a miss and has the worst case time of O(2n) on eviction due to queues being scanned.

    This implementation is based on the pseudo code provided by the authors in their paper CAR: Clock with Adaptive Replacement and is further described in their paper,

    This algorithm is patented by IBM (6996676, 7096321, 7058766, 8612689).

    • Constructor Detail

      • CarPolicy

        public CarPolicy​(Config config)
    • Method Detail

      • stats

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

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