Interface Admittor
-
- All Known Subinterfaces:
Admittor.KeyOnlyAdmittor
- All Known Implementing Classes:
TinyLfu
public interface AdmittorAn admission policy to the cache. A page replacement policy always admits new entries and chooses a victim to remove if the cache exceeds a maximum size. An admission policy augments the eviction policy by letting the cache not accept the new entry, based on the assumption that the victim is more likely to be used again.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAdmittor.KeyOnlyAdmittorAn admission policy that does not exploit external event metadata.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanadmit(long candidateKey, long victimKey)Returns if the candidate should be added to the cache and the page replacement policy's chosen victim should be removed.booleanadmit(AccessEvent candidate, AccessEvent victim)Returns if the candidate should be added to the cache and the page replacement policy's chosen victim should be removed.static Admittoralways()Returns an admittor that admits every candidate.default voidrecord(long key)Records the access to the entry.voidrecord(AccessEvent event)Records the access to the entry.
-
-
-
Method Detail
-
record
void record(AccessEvent event)
Records the access to the entry.
-
record
default void record(long key)
Records the access to the entry.
-
admit
boolean admit(AccessEvent candidate, AccessEvent victim)
Returns if the candidate should be added to the cache and the page replacement policy's chosen victim should be removed.- Parameters:
candidate- the event of the newly added entryvictim- the event of the entry the policy recommends removing- Returns:
- if the candidate should be added and the victim removed due to eviction
-
admit
default boolean admit(long candidateKey, long victimKey)Returns if the candidate should be added to the cache and the page replacement policy's chosen victim should be removed.- Parameters:
candidateKey- the key to the newly added entryvictimKey- the key to the entry the policy recommends removing- Returns:
- if the candidate should be added and the victim removed due to eviction
-
always
static Admittor always()
Returns an admittor that admits every candidate.
-
-