org.eclipse.jgit.storage.dht.spi
Interface WriteBuffer

All Known Implementing Classes:
AbstractWriteBuffer, CacheBuffer

public interface WriteBuffer

Potentially buffers writes until full, or until flush.


Method Summary
 void abort()
          Abort pending writes, and wait for acknowledgment.
 void flush()
          Flush any pending writes, and wait for them to complete.
 

Method Detail

flush

void flush()
           throws DhtException
Flush any pending writes, and wait for them to complete.

Throws:
DhtException - one or more writes failed. As writes may occur in any order, the exact state of the database is unspecified.

abort

void abort()
           throws DhtException
Abort pending writes, and wait for acknowledgment.

Once a buffer has been aborted, it cannot be reused. Application code must discard the buffer instance and use a different buffer to issue subsequent operations.

If writes have not been started yet, they should be discarded and not submitted to the storage system.

If writes have already been started asynchronously in the background, this method may try to cancel them, but must wait for the operation to either complete or abort before returning. This allows callers to clean up by scanning the storage system and making corrections to clean up any partial writes.

Throws:
DhtException - one or more already started writes failed.


Copyright © 2011. All Rights Reserved.