java.lang.Object | |
↳ | com.facebook.imagepipeline.cache.BufferedDiskCache |
BufferedDiskCache provides get and put operations to take care of scheduling disk-cache read/writes.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BufferedDiskCache(FileCache fileCache, PooledByteBufferFactory pooledByteBufferFactory, PooledByteStreams pooledByteStreams, Executor readExecutor, Executor writeExecutor, ImageCacheStatsTracker imageCacheStatsTracker) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | addKeyForAsyncProbing(CacheKey key) | ||||||||||
Task<Void> |
clearAll()
Clears the disk cache and the staging area.
| ||||||||||
Task<Boolean> |
contains(CacheKey key)
Performs a key-value look up in the disk cache.
| ||||||||||
boolean |
containsSync(CacheKey key)
Returns true if the key is in the in-memory key index.
| ||||||||||
boolean |
diskCheckSync(CacheKey key)
Performs disk cache check synchronously.
| ||||||||||
Task<EncodedImage> |
get(CacheKey key, AtomicBoolean isCancelled)
Performs key-value look up in disk cache.
| ||||||||||
long | getSize() | ||||||||||
Task<Void> |
probe(CacheKey key)
Performs key-value look up in disk cache.
| ||||||||||
void |
put(CacheKey key, EncodedImage encodedImage)
Associates encodedImage with given key in disk cache.
| ||||||||||
Task<Void> |
remove(CacheKey key)
Removes the item from the disk cache and the staging area.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Clears the disk cache and the staging area.
Performs a key-value look up in the disk cache. If no value is found in the staging area, then disk cache checks are scheduled on a background thread. Any error manifests itself as a cache miss, i.e. the returned Task resolves to false.
Returns true if the key is in the in-memory key index.
Not guaranteed to be correct. The cache may yet have this key even if this returns false. But if it returns true, it definitely has it.
Avoids a disk read.
Performs disk cache check synchronously.
Performs key-value look up in disk cache. If value is not found in disk cache staging area then disk cache read is scheduled on background thread. Any error manifests itself as cache miss, i.e. the returned task resolves to null.
Performs key-value look up in disk cache. If value is not found in disk cache staging area then disk cache probing is scheduled on background thread.
Associates encodedImage with given key in disk cache. Disk write is performed on background thread, so the caller of this method is not blocked