public interface EvictionPolicy
One policy instance belongs to exactly one cache instance
| Modifier and Type | Interface and Description |
|---|---|
static class |
EvictionPolicy.EvictionType
Types of eviction policies
AGE - based on the time of access, e.g., LRU
FREQ - based on the frequency of access, e.g., LFU
HYBR - AGE + FREQ, e.g., CLOCK
MISC - Anythin that isn't time based, frequency based or a combination of the two, e.g., FIFO
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<CacheKey> |
evictMany(int n) |
CacheKey |
evictNext()
Evict the next element from the cache
This one should provide O(1) complexity
|
Cache |
getCache() |
java.lang.String |
getName() |
EvictionPolicy.EvictionType |
getType() |
boolean |
reset(CacheKey cacheKey)
Resets the state that the eviction policy maintains about the cache key
|
int |
resetAll()
Resets the entire state of the eviction data
|
void |
setCache(Cache cache)
Sets the cache that is associated to this policy instance
|
void |
touch(CacheKey cacheKey)
Indicates that a cache key was touched
This one should provide O(1) complexity
|
Cache getCache()
void setCache(Cache cache)
cache - The cache instanceEvictionPolicy.EvictionType getType()
java.lang.String getName()
CacheKey evictNext()
java.util.List<CacheKey> evictMany(int n)
n - The number of entries to evictvoid touch(CacheKey cacheKey)
cacheKey - The key within the cacheboolean reset(CacheKey cacheKey)
cacheKey - int resetAll()
Copyright © 2025. All rights reserved.