java.lang.Object | |
↳ | com.facebook.cache.disk.SettableCacheEvent |
Implementation of CacheEvent
that allows the values to be set and supports recycling of
instances.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CacheKey |
getCacheKey()
Gets the cache key related to this event.
| ||||||||||
long |
getCacheLimit()
Gets the current size limit for the cache, in bytes.
| ||||||||||
long |
getCacheSize()
Gets the total size of the resources currently in storage, in bytes.
| ||||||||||
CacheEventListener.EvictionReason |
getEvictionReason()
Gets the reason for an item's eviction in eviction events.
| ||||||||||
IOException |
getException()
Gets the exception which occurred to trigger a read or write exception event.
| ||||||||||
long |
getItemSize()
Gets the size of the new resource in storage, in bytes.
| ||||||||||
String |
getResourceId()
Gets the resource ID for the cached item.
| ||||||||||
static SettableCacheEvent | obtain() | ||||||||||
void | recycle() | ||||||||||
SettableCacheEvent | setCacheKey(CacheKey cacheKey) | ||||||||||
SettableCacheEvent | setCacheLimit(long cacheLimit) | ||||||||||
SettableCacheEvent | setCacheSize(long cacheSize) | ||||||||||
SettableCacheEvent | setEvictionReason(CacheEventListener.EvictionReason evictionReason) | ||||||||||
SettableCacheEvent | setException(IOException exception) | ||||||||||
SettableCacheEvent | setItemSize(long itemSize) | ||||||||||
SettableCacheEvent | setResourceId(String resourceId) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.cache.common.CacheEvent
|
Gets the cache key related to this event.
This should be present for all events other than eviction.
Gets the current size limit for the cache, in bytes.
This is present in eviction events where the eviction is due to the need to trim for size.
Gets the total size of the resources currently in storage, in bytes.
This is present in write success and eviction events.
Gets the reason for an item's eviction in eviction events.
Gets the exception which occurred to trigger a read or write exception event.
Gets the size of the new resource in storage, in bytes.
This is present in write success and eviction events.
Gets the resource ID for the cached item.
This is present in cache hit, write success, read and write exceptions and evictions.
It may also be present in cache miss events if an ID was found in the cache's index but the resource wasn't then found in storage.