Interface Snapshot

All Superinterfaces:
AutoCloseable, Closeable

public interface Snapshot extends Closeable
Control object used to capture a database snapshot.
See Also:
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Can be called by another thread to abort the snapshot, causing any thread in the writeTo method to throw an exception.
    boolean
    Returns false if the snapshot isn't compressible, either because it's already compressed, or if it's encrypted.
    long
    Returns total amount of bytes expected to be written to the snapshot stream.
    long
    Returns the log start position that the snapshot applies to.
    void
    Writes out snapshot data, and then closes this object.
  • Method Details Link icon

    • length Link icon

      long length()
      Returns total amount of bytes expected to be written to the snapshot stream.
    • position Link icon

      long position()
      Returns the log start position that the snapshot applies to.
    • isCompressible Link icon

      boolean isCompressible()
      Returns false if the snapshot isn't compressible, either because it's already compressed, or if it's encrypted.
    • writeTo Link icon

      void writeTo(OutputStream out) throws IOException
      Writes out snapshot data, and then closes this object. Snapshot aborts if the OutputStream throws an exception or if another thread closes this Snapshot instance.
      Parameters:
      out - snapshot destination; does not require extra buffering; not auto-closed
      Throws:
      IOException
    • close Link icon

      void close() throws IOException
      Can be called by another thread to abort the snapshot, causing any thread in the writeTo method to throw an exception.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException