Class ArcPolicy

  • All Implemented Interfaces:
    Policy, Policy.KeyOnlyPolicy

    public final class ArcPolicy
    extends Object
    implements Policy.KeyOnlyPolicy
    Adaptive Replacement Cache. This algorithm uses a queue for items that are seen once (T1), a queue for items seen multiple times (T2), and non-resident queues for evicted items that are being monitored (B1, B2). The maximum size of the T1 and T2 queues is adjusted dynamically based on the workload patterns and effectiveness of the cache.

    This implementation is based on the pseudocode provided by the authors in their paper Outperforming LRU with an Adaptive Replacement Cache Algorithm and is further described in their paper, ARC: A Self-Tuning, Low Overhead Replacement Cache.

    This algorithm is patented by IBM (6996676, 7096321, 7058766, 8612689) and Sun (7469320), making its use in applications ambiguous due to Sun's ZFS providing an implementation under the CDDL.

    • Constructor Detail

      • ArcPolicy

        public ArcPolicy​(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