Class FeedbackWindowTinyLfuPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.sketch.feedback.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec
-
-
Constructor Summary
Constructors Constructor Description FeedbackWindowTinyLfuPolicy(double percentMain, com.github.benmanes.caffeine.cache.simulator.policy.sketch.feedback.FeedbackWindowTinyLfuPolicy.FeedbackWindowTinyLfuSettings settings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinished()Indicates that the recording has completed.static Set<Policy>policies(Config config)Returns all variations of this policy based on the configuration parameters.voidrecord(long key)PolicyStatsstats()Returns the cache efficiency statistics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy.KeyOnlyPolicy
record
-
-
-
-
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:PolicyReturns the cache efficiency statistics.
-
record
public void record(long key)
- Specified by:
recordin interfacePolicy.KeyOnlyPolicy
-
-