Interface MetadataSnapshot
- All Superinterfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordStable content-integrity metadata without payload or storage details.static final recordAn ordered range within one semantic namespace.static interfaceA repeatable record view owned by a snapshot. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this snapshot idempotently and invalidates its cursors.get(MetadataKey key) Reads one record from this stable view.greatestKey(String namespace) Returns the greatest key in one namespace without opening record content.longrevision()Returns the captured non-negative committed store revision.scan(MetadataSnapshot.KeyRange range, CancellationSignal cancellation) Opens a lazy deterministic scan over this stable view.storeId()Returns the issuing store identity.
-
Method Details
-
storeId
-
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 openedMetadataStoreException- when this snapshot is closed or foreign
-
greatestKey
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
MetadataCursor scan(MetadataSnapshot.KeyRange range, CancellationSignal cancellation) throws IOException Opens a lazy deterministic scan over this stable view.- Parameters:
range- ordered semantic rangecancellation- cooperative cancellation signal- Returns:
- store-issued cursor
- Throws:
IOException- when the scan cannot be openedMetadataStoreException- when this snapshot is closed or foreign
-
close
void close()Closes this snapshot idempotently and invalidates its cursors.- Specified by:
closein interfaceAutoCloseable
-