Interface MetadataSnapshot

All Superinterfaces:
AutoCloseable

public interface MetadataSnapshot extends AutoCloseable
An immutable, store-issued view of one committed metadata revision.

Reads and scans never observe later commits. The snapshot and all live objects it issues remain bound to the exact issuing store instance.

  • Method Details

    • storeId

      MetadataStoreId storeId()
      Returns the issuing store identity.
      Returns:
      store identity
    • revision

      long revision()
      Returns the captured non-negative committed store revision.
      Returns:
      snapshot revision
    • get

      Reads one record from this stable view.
      Parameters:
      key - semantic record identity
      Returns:
      the stable record, or empty when absent
      Throws:
      IOException - when content metadata cannot be opened
      MetadataStoreException - when this snapshot is closed or foreign
    • greatestKey

      Optional<MetadataKey> greatestKey(String namespace)
      Returns the greatest key in one namespace without opening record content.
      Parameters:
      namespace - canonical metadata namespace
      Returns:
      greatest snapshot key, or empty when the namespace is empty
      Throws:
      IllegalStateException - when this snapshot is closed or foreign
    • scan

      Opens a lazy deterministic scan over this stable view.
      Parameters:
      range - ordered semantic range
      cancellation - cooperative cancellation signal
      Returns:
      store-issued cursor
      Throws:
      IOException - when the scan cannot be opened
      MetadataStoreException - when this snapshot is closed or foreign
    • close

      void close()
      Closes this snapshot idempotently and invalidates its cursors.
      Specified by:
      close in interface AutoCloseable