CacheEvictor
@UnstableApi
interface CacheEvictor : 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 functions |
|
|---|---|
Unit |
Called when cache has been initialized. |
Unit |
onStartFile(cache: Cache!, key: String!, position: Long, length: Long)Called when a writer starts writing to the cache. |
Boolean |
Returns whether the evictor requires the |
Inherited functions |
||||||
|---|---|---|---|---|---|---|
|
Public functions
onStartFile
fun onStartFile(cache: Cache!, key: String!, position: Long, length: Long): Unit
Called when a writer starts writing to the cache.
| Parameters | |
|---|---|
cache: Cache! |
The source of the event. |
key: String! |
The key being written. |
position: Long |
The starting position of the data being written. |
length: Long |
The length of the data being written, or |
requiresCacheSpanTouches
fun requiresCacheSpanTouches(): Boolean
Returns whether the evictor requires the Cache to touch CacheSpans when it accesses them. Implementations that do not use lastTouchTimestamp should return false.