-
public interface DiskStorage.InserterThis is a builder-like interface returned when calling insert. It holds all the operationscarried through an insert operation: - writing data - committing - clean up
-
-
Method Summary
Modifier and Type Method Description abstract voidwriteData(WriterCallback callback, Object debugInfo)Update the contents of the resource to be inserted. abstract BinaryResourcecommit(Object debugInfo)Commits the insertion into the cache. abstract BinaryResourcecommit(Object debugInfo, long time)Commits the insertion into the cache. abstract booleancleanUp()Discards the insertion process. -
-
Method Detail
-
writeData
abstract void writeData(WriterCallback callback, Object debugInfo)
Update the contents of the resource to be inserted. Executes outside the session lock. Thewriter callback will be provided with an OutputStream to write to. For high efficiency clientshould make sure that data is written in big chunks (for example by employingBufferedInputStream or writing all data at once).
- Parameters:
callback- the write callbackdebugInfo- helper object for debugging
-
commit
abstract BinaryResource commit(Object debugInfo)
Commits the insertion into the cache. Once this is called the entry will be available toclients of the cache.
- Parameters:
debugInfo- debug object for debugging
-
commit
abstract BinaryResource commit(Object debugInfo, long time)
Commits the insertion into the cache. Once this is called the entry will be available toclients of the cache. It also sets the file's timestamp according to the time passed as anargument.
- Parameters:
debugInfo- debug object for debuggingtime- in milliseconds
-
cleanUp
abstract boolean cleanUp()
Discards the insertion process. If resource was already committed the call is ignored.
-
-
-
-