Class FeedbackTinyLfuPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.sketch.feedback.FeedbackTinyLfuPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class FeedbackTinyLfuPolicy extends Object implements Policy.KeyOnlyPolicy
The TinyLfu + Lru algorithm where arrival is given more emphasis based on success of previous predictions. If a candidate is rejected multiple times within a sample period then a new arrival is given a higher frequency gain. The gain is decreased on an eviction if no adjustments have been made recently. This allows the policy to dynamically decide whether it should favor recency or frequency 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 FeedbackTinyLfuPolicy(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinished()Indicates that the recording has completed.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
-
-
-
-
Constructor Detail
-
FeedbackTinyLfuPolicy
public FeedbackTinyLfuPolicy(Config config)
-
-
Method Detail
-
stats
public PolicyStats stats()
Description copied from interface:PolicyReturns the cache efficiency statistics.
-
record
public void record(long key)
- Specified by:
recordin interfacePolicy.KeyOnlyPolicy
-
-