Package 

Interface DiskStorage.Inserter


  • 
    public interface DiskStorage.Inserter
    
                        

    This 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 void writeData(WriterCallback callback, Object debugInfo) Update the contents of the resource to be inserted.
      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 boolean cleanUp() Discards the insertion process.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 callback
        debugInfo - 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 debugging
        time - in milliseconds
      • cleanUp

         abstract boolean cleanUp()

        Discards the insertion process. If resource was already committed the call is ignored.