Interface Snapshot<K extends Comparable<K>,V>

Type Parameters:
K - the type of the key
V - the type of the value
All Superinterfaces:
AutoCloseable

public interface Snapshot<K extends Comparable<K>,V> extends AutoCloseable
Interface for a snapshot of a database. Represents a point-in-time view of a storage, with a unique ID.
  • Method Details

    • getIterator

      List<CloseableKvIterator<K,MaybeTombstone<V>>> getIterator(IteratorStart start, K key)
      Get a list of iterators representing the snapshot. The iterators have priority: the first one in the list is the highest. The data type of the iterator is a tombstone: a tombstone represents a deleted value that does not exist anymore. The list of iterators is intended to be consumed by TombstoneSkippingIterator
      Returns:
      a list of iterators
    • readObject

      @Nonnull Optional<V> readObject(K name)
      Read an object from the snapshot.
      Parameters:
      name - the name of the object
      Returns:
      an optional containing the object if it exists, or an empty optional if it does not
    • id

      long id()
      Get the ID of the snapshot.
      Returns:
      the ID of the snapshot
    • close

      void close()
      Specified by:
      close in interface AutoCloseable