public final class NoOpCacheEvictor extends Object implements CacheEvictor
Constructor and Description |
---|
NoOpCacheEvictor() |
Modifier and Type | Method and Description |
---|---|
void |
onCacheInitialized()
Invoked when cache has beeen initialized.
|
void |
onSpanAdded(Cache cache,
CacheSpan span)
Invoked when a
CacheSpan is added to the cache. |
void |
onSpanRemoved(Cache cache,
CacheSpan span)
Invoked when a
CacheSpan is removed from the cache. |
void |
onSpanTouched(Cache cache,
CacheSpan oldSpan,
CacheSpan newSpan)
Invoked when an existing
CacheSpan is accessed, causing it to be replaced. |
void |
onStartFile(Cache cache,
String key,
long position,
long length)
Invoked when a writer starts writing to the cache.
|
public void onCacheInitialized()
CacheEvictor
onCacheInitialized
in interface CacheEvictor
public void onStartFile(Cache cache, String key, long position, long length)
CacheEvictor
onStartFile
in interface CacheEvictor
cache
- The source of the event.key
- The key being written.position
- The starting position of the data being written.length
- The maximum length of the data being written.public void onSpanAdded(Cache cache, CacheSpan span)
Cache.Listener
CacheSpan
is added to the cache.onSpanAdded
in interface Cache.Listener
cache
- The source of the event.span
- The added CacheSpan
.public void onSpanRemoved(Cache cache, CacheSpan span)
Cache.Listener
CacheSpan
is removed from the cache.onSpanRemoved
in interface Cache.Listener
cache
- The source of the event.span
- The removed CacheSpan
.public void onSpanTouched(Cache cache, CacheSpan oldSpan, CacheSpan newSpan)
Cache.Listener
CacheSpan
is accessed, causing it to be replaced. The new
CacheSpan
is guaranteed to represent the same data as the one it replaces, however
CacheSpan.file
and CacheSpan.lastAccessTimestamp
may have changed.
Note that for span replacement, Cache.Listener.onSpanAdded(Cache, CacheSpan)
and
Cache.Listener.onSpanRemoved(Cache, CacheSpan)
are not invoked in addition to this method.
onSpanTouched
in interface Cache.Listener
cache
- The source of the event.oldSpan
- The old CacheSpan
, which has been removed from the cache.newSpan
- The new CacheSpan
, which has been added to the cache.