-
- All Implemented Interfaces:
-
com.facebook.cache.common.HasDebugData,com.facebook.common.memory.MemoryTrimmable,com.facebook.imagepipeline.cache.MemoryCache
public interface CountingMemoryCache<K, V> implements MemoryCache<K, V>, MemoryTrimmable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCountingMemoryCache.EntryStateObserverInterface used to observe the state changes of an entry.
public classCountingMemoryCache.EntryThe internal representation of a key-value pair stored by the cache.
-
Method Summary
Modifier and Type Method Description abstract CloseableReference<V>cache(K key, CloseableReference<V> valueRef, CountingMemoryCache.EntryStateObserver<K> observer)abstract CloseableReference<V>reuse(K key)abstract voidmaybeEvictEntries()Removes the exclusively owned items until the cache constraints are met. abstract intgetInUseSizeInBytes()Gets the total size in bytes of the cached items that are used by at least one client. abstract intgetEvictionQueueCount()Gets the total size in bytes of the cached items that are used by at least one client. abstract intgetEvictionQueueSizeInBytes()Gets the total size in bytes of the exclusively owned items. abstract voidclear()Removes all the items from the cache. abstract MemoryCacheParamsgetMemoryCacheParams()abstract CountingLruMap<K, CountingMemoryCache.Entry<K, V>>getCachedEntries()abstract Map<Bitmap, Object>getOtherEntries()-
Methods inherited from class com.facebook.imagepipeline.cache.MemoryCache
cache, contains, get, getCount, getSizeInBytes, inspect, probe, removeAll -
Methods inherited from class com.facebook.common.memory.MemoryTrimmable
trim -
Methods inherited from class com.facebook.cache.common.HasDebugData
getDebugData -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
cache
@Nullable() abstract CloseableReference<V> cache(K key, CloseableReference<V> valueRef, CountingMemoryCache.EntryStateObserver<K> observer)
-
maybeEvictEntries
abstract void maybeEvictEntries()
Removes the exclusively owned items until the cache constraints are met.
This method invokes the external close method, so it must not becalled while holding the
thislock.
-
getInUseSizeInBytes
abstract int getInUseSizeInBytes()
Gets the total size in bytes of the cached items that are used by at least one client.
-
getEvictionQueueCount
abstract int getEvictionQueueCount()
Gets the total size in bytes of the cached items that are used by at least one client.
-
getEvictionQueueSizeInBytes
abstract int getEvictionQueueSizeInBytes()
Gets the total size in bytes of the exclusively owned items.
-
clear
abstract void clear()
Removes all the items from the cache.
-
getMemoryCacheParams
abstract MemoryCacheParams getMemoryCacheParams()
-
getCachedEntries
@Nullable() abstract CountingLruMap<K, CountingMemoryCache.Entry<K, V>> getCachedEntries()
-
getOtherEntries
@Nullable() abstract Map<Bitmap, Object> getOtherEntries()
-
-
-
-