Interface Store.Editor
- All Superinterfaces:
AutoCloseable, Closeable
- Enclosing interface:
Store
Writes an entry's metadata block and data stream.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this editor.default voidcommit(ByteBuffer metadata) Synchronous variant ofcommit(ByteBuffer, Executor).commit(ByteBuffer metadata, Executor executor) Commits the changes made so far.key()Returns the entry's key.writer()Returns the writer associated with this editor, which is at most one.
-
Method Details
-
key
String key()Returns the entry's key. -
writer
Store.EntryWriter writer()Returns the writer associated with this editor, which is at most one. Although a writer is safe for concurrent use, it is expected to be used serially, that is, one write at a time. -
commit
Synchronous variant ofcommit(ByteBuffer, Executor).- Throws:
IllegalStateException- if the edit couldn't be committed, usually due to closureIOException
-
commit
Commits the changes made so far.- Throws:
IllegalStateException- if closed
-
close
void close()Closes this editor. Ifcommit(ByteBuffer)hasn't been called prior to this method, changes made by this editor are discarded.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-