Module methanol

Interface Store.Editor

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    Enclosing interface:
    Store

    public static interface Store.Editor
    extends java.io.Closeable
    Writes an entry's metadata block and data stream.
    • 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.IOException
        Synchronous variant of commit(ByteBuffer, Executor).
        Throws:
        java.lang.IllegalStateException - if the edit couldn't be committed, usually due to closure
        java.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. If commit(ByteBuffer) hasn't been called prior to this method, changes made by this editor are discarded.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable