Class FeedbackWindowTinyLfuPolicy

  • All Implemented Interfaces:
    Policy, Policy.KeyOnlyPolicy

    public final class FeedbackWindowTinyLfuPolicy
    extends Object
    implements Policy.KeyOnlyPolicy
    The Window TinyLfu algorithm where the size of the admission window is adjusted based on the workload. If a candidate is rejected multiple times within a sample period then the window is increased. The window is decreased on an eviction if no adjustments have been made for at least two periods. This allows the policy to dynamically decide whether it should favor recency (larger window) or frequency (smaller window) based on the workload's characteristics. If the workload changes then the policy will adapt to the new environment.
    • Constructor Detail

      • FeedbackWindowTinyLfuPolicy

        public FeedbackWindowTinyLfuPolicy​(double percentMain,
                                           com.github.benmanes.caffeine.cache.simulator.policy.sketch.feedback.FeedbackWindowTinyLfuPolicy.FeedbackWindowTinyLfuSettings settings)
    • Method Detail

      • policies

        public static Set<Policy> policies​(Config config)
        Returns all variations of this policy based on the configuration parameters.
      • 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