Interface Snapshot

All Superinterfaces:
AutoCloseable, Closeable

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

    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

    • length

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

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

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

      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

      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