com.facebook.cache.disk.DiskStorage.Inserter |
This is a builder-like interface returned when calling insert. It holds all the operations
carried through an insert(String, Object)
operation: - writing data - committing - clean up
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean |
cleanUp()
Discards the insertion process.
| ||||||||||
abstract BinaryResource |
commit(Object debugInfo)
Commits the insertion into the cache.
| ||||||||||
abstract BinaryResource |
commit(Object debugInfo, long time)
Commits the insertion into the cache.
| ||||||||||
abstract void |
writeData(WriterCallback callback, Object debugInfo)
Update the contents of the resource to be inserted.
|
Discards the insertion process. If resource was already committed the call is ignored.
Commits the insertion into the cache. Once this is called the entry will be available to clients of the cache.
debugInfo | debug object for debugging |
---|
IOException | on errors during the commit |
---|
Commits the insertion into the cache. Once this is called the entry will be available to clients of the cache. It also sets the file's timestamp according to the time passed as an argument.
debugInfo | debug object for debugging |
---|---|
time | in milliseconds |
IOException | on errors during the commit |
---|
Update the contents of the resource to be inserted. Executes outside the session lock. The writer callback will be provided with an OutputStream to write to. For high efficiency client should make sure that data is written in big chunks (for example by employing BufferedInputStream or writing all data at once).
callback | the write callback |
---|---|
debugInfo | helper object for debugging |
IOException |
---|