Class MiniSimClimber
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.sketch.climbing.sim.MiniSimClimber
-
- All Implemented Interfaces:
HillClimber
public final class MiniSimClimber extends Object implements HillClimber
A MinSim version for W-TinyLFU.The algorithm is explained by the authors in Cache Modeling and Optimization using Miniature Simulation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.sketch.climbing.HillClimber
HillClimber.Adaptation, HillClimber.QueueType
-
-
Constructor Summary
Constructors Constructor Description MiniSimClimber(Config config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HillClimber.Adaptationadapt(double windowSize, double probationSize, double protectedSize, boolean isFull)Determines how to adapt the segment sizes.voidonHit(long key, HillClimber.QueueType queue, boolean isFull)Records that a hit occurred with a full cache.voidonMiss(long key, boolean isFull)Records that a miss occurred with a full cache.
-
-
-
Constructor Detail
-
MiniSimClimber
public MiniSimClimber(Config config)
-
-
Method Detail
-
onHit
public void onHit(long key, HillClimber.QueueType queue, boolean isFull)Description copied from interface:HillClimberRecords that a hit occurred with a full cache.- Specified by:
onHitin interfaceHillClimber- Parameters:
key- the key accessedqueue- the queue the entry was found inisFull- if the cache is fully populated
-
onMiss
public void onMiss(long key, boolean isFull)Description copied from interface:HillClimberRecords that a miss occurred with a full cache.- Specified by:
onMissin interfaceHillClimber- Parameters:
key- the key accessedisFull- if the cache is fully populated and had to evict
-
adapt
public HillClimber.Adaptation adapt(double windowSize, double probationSize, double protectedSize, boolean isFull)
Description copied from interface:HillClimberDetermines how to adapt the segment sizes.- Specified by:
adaptin interfaceHillClimber- Parameters:
windowSize- the current window sizeprobationSize- the current probation sizeprotectedSize- the current protected sizeisFull- if the cache is fully populated- Returns:
- the adjustment to the segments
-
-