Module methanol

Interface Store.Viewer

All Superinterfaces:
AutoCloseable, Closeable
Enclosing interface:
Store

public static interface Store.Viewer extends Closeable
Reads an entry's metadata block and data stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this viewer.
    long
    Returns the size in bytes of the data stream.
    Returns an editor for this viewer's entry, or null if another edit is in progress or if the entry has been modified since this viewer was created.
    long
    Returns the size in bytes of the metadata block and data stream.
    key()
    Returns the entry's key.
    Returns a readonly buffer containing the entry's metadata.
     
    boolean
    Removes the entry associated with this viewer only if it hasn't changed since this viewer was opened.
  • Method Details

    • key

      String key()
      Returns the entry's key.
    • metadata

      ByteBuffer metadata()
      Returns a readonly buffer containing the entry's metadata.
    • newReader

      Store.EntryReader newReader()
    • dataSize

      long dataSize()
      Returns the size in bytes of the data stream.
    • entrySize

      long entrySize()
      Returns the size in bytes of the metadata block and data stream.
    • edit

      Returns an editor for this viewer's entry, or null if another edit is in progress or if the entry has been modified since this viewer was created. Changes made by the returned editor are not reflected by this viewer.
      Throws:
      IllegalStateException - if the store is closed
      IOException
      InterruptedException
    • removeEntry

      boolean removeEntry() throws IOException
      Removes the entry associated with this viewer only if it hasn't changed since this viewer was opened.
      Throws:
      IllegalStateException - if the store is closed
      IOException
    • close

      void close()
      Closes this viewer.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable