CacheEvictor
@UnstableApi
public interface CacheEvictor extends Cache.Listener
LeastRecentlyUsedCacheEvictor |
Evicts least recently used cache files first. |
NoOpCacheEvictor |
Evictor that doesn't ever evict cache files. |
Evicts data from a Cache. Implementations should call removeSpan to evict cache entries based on their eviction policies.
Summary
Public methods |
|
|---|---|
abstract void |
Called when cache has been initialized. |
abstract void |
onStartFile(Cache cache, String key, long position, long length)Called when a writer starts writing to the cache. |
abstract boolean |
Returns whether the evictor requires the |
Inherited methods |
||||||
|---|---|---|---|---|---|---|
|
Public methods
onStartFile
abstract void onStartFile(Cache cache, String key, long position, long length)
Called when a writer starts writing to the cache.
| Parameters | |
|---|---|
Cache cache |
The source of the event. |
String key |
The key being written. |
long position |
The starting position of the data being written. |
long length |
The length of the data being written, or |
requiresCacheSpanTouches
abstract boolean requiresCacheSpanTouches()
Returns whether the evictor requires the Cache to touch CacheSpans when it accesses them. Implementations that do not use lastTouchTimestamp should return false.