docs/javadoc/reference/com/facebook/cache/disk/DiskStorageCache.html
|
|
Summary: Nested Classes | Constants | Ctors | Methods | Protected Methods | Inherited Methods | [Expand All]
public class
extends Object
implements FileCacheDiskTrimmable
| java.lang.Object | | ↳ | com.facebook.cache.disk.DiskStorageCache |
Cache that manages disk storage.
| Nested Classes |
|---|
| class |
| Constants |
|---|
| int |
| Public Constructors |
|---|
| Public Methods |
|---|
| void |
| long |
| Deletes old cache files. |
| long |
| DiskStorage.DiskDumpInfo |
| BinaryResource |
| Retrieves the file corresponding to the mKey, if it is in the cache. |
| long |
| boolean |
| boolean |
| Returns true if the key is in the in-memory key index. |
| BinaryResource |
| Inserts resource into file with key |
| boolean |
| Tells if this cache is enabled. |
| boolean |
| Tells if memory index is completed in initialization. |
| boolean |
| Probes whether the object corresponding to the mKey is in the cache. |
| void |
| Removes a resource by key from cache. |
| void |
| Called when there is very little disk space left. |
| void |
| Called when there is almost no disk space left and the app is likely to crash soon |
| Protected Methods |
|---|
| void |
| Blocks current thread until having finished initialization in Memory Index. |
| [Expand] Inherited Methods | | --- | | From class java.lang.Object
| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |
| | From interface com.facebook.cache.disk.FileCache
| abstract void | clearAll() | | abstract long | clearOldEntries(long cacheExpirationMs) Deletes old cache files. | | abstract long | getCount() | | abstract DiskStorage.DiskDumpInfo | getDumpInfo() | | abstract BinaryResource | getResource(CacheKey key) Returns the binary resource cached with key. | | abstract long | getSize() | | abstract boolean | hasKey(CacheKey key) | | abstract boolean | hasKeySync(CacheKey key) Returns true if the key is in the in-memory key index. | | abstract BinaryResource | insert(CacheKey key, WriterCallback writer) Inserts resource into file with key | | abstract boolean | isEnabled() Tells if this cache is enabled. | | abstract boolean | probe(CacheKey key) | | abstract void | remove(CacheKey key) Removes a resource by key from cache. |
| | From interface com.facebook.common.disk.DiskTrimmable
| abstract void | trimToMinimum() Called when there is very little disk space left. | | abstract void | trimToNothing() Called when there is almost no disk space left and the app is likely to crash soon |
|
Constant Value: 1 (0x00000001)
Deletes old cache files.
| cacheExpirationMs | files older than this will be deleted. |
| IOException | |
Retrieves the file corresponding to the mKey, if it is in the cache. Also touches the item, thus changing its LRU timestamp. If the file is not present in the file cache, returns null.
This should NOT be called on the UI thread.
| key | the mKey to check |
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.
Inserts resource into file with key
| key | cache key | | callback | Callback that writes to an output stream |
| IOException | |
Tells if this cache is enabled. It's important for some caches that can be disabled without further notice (like in removable/unmountable storage). Anyway a disabled cache should just ignore calls, not fail.
Tells if memory index is completed in initialization. Only call it when you need to know if memory index is completed in cold start.
Probes whether the object corresponding to the mKey is in the cache. Note that the act of probing touches the item (if present in cache), thus changing its LRU timestamp.
This will be faster than retrieving the object, but it still has file system accesses and should NOT be called on the UI thread.
| key | the mKey to check |
Removes a resource by key from cache.
| key | cache key |
Called when there is very little disk space left.
Called when there is almost no disk space left and the app is likely to crash soon
Blocks current thread until having finished initialization in Memory Index. Call only when you need memory index in cold start.
+Generated by Doclava. +