NoOpCacheEvictor
@UnstableApi
class NoOpCacheEvictor : CacheEvictor
Evictor that doesn't ever evict cache files.
Warning: Using this evictor might have unforeseeable consequences if cache size is not managed elsewhere.
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
Unit |
Called when cache has been initialized. |
Unit |
onSpanAdded(cache: Cache!, span: CacheSpan!)Called when a |
Unit |
onSpanRemoved(cache: Cache!, span: CacheSpan!)Called when a |
Unit |
onSpanTouched(cache: Cache!, oldSpan: CacheSpan!, newSpan: CacheSpan!)Called when an existing |
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 |
Public constructors
Public functions
onSpanAdded
fun onSpanAdded(cache: Cache!, span: CacheSpan!): Unit
Called when a CacheSpan is added to the cache.
onSpanRemoved
fun onSpanRemoved(cache: Cache!, span: CacheSpan!): Unit
Called when a CacheSpan is removed from the cache.
onSpanTouched
fun onSpanTouched(cache: Cache!, oldSpan: CacheSpan!, newSpan: CacheSpan!): Unit
Called when an existing CacheSpan is touched, causing it to be replaced. The new CacheSpan is guaranteed to represent the same data as the one it replaces, however file and lastTouchTimestamp may have changed.
Note that for span replacement, onSpanAdded and onSpanRemoved are not called in addition to this method.
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.