-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- Enclosing interface:
- Store
public static interface Store.Editor extends java.io.CloseableWrites an entry's metadata block and data stream.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Closes this editor.default voidcommit(java.nio.ByteBuffer metadata)Synchronous variant ofcommit(ByteBuffer, Executor).java.util.concurrent.CompletableFuture<java.lang.Void>commit(java.nio.ByteBuffer metadata, java.util.concurrent.Executor executor)Commits the changes made so far.java.lang.Stringkey()Returns the entry's key.Store.EntryWriterwriter()Returns the writer associated with this editor, which is at most one.
-
-
-
Method Detail
-
key
java.lang.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
default void commit(java.nio.ByteBuffer metadata) throws java.io.IOExceptionSynchronous variant ofcommit(ByteBuffer, Executor).- Throws:
java.lang.IllegalStateException- if the edit couldn't be committed, usually due to closurejava.io.IOException
-
commit
java.util.concurrent.CompletableFuture<java.lang.Void> commit(java.nio.ByteBuffer metadata, java.util.concurrent.Executor executor)Commits the changes made so far.- Throws:
java.lang.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 interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-