Class Snapshot
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
A point-in-time consistent view of the database. Maps to
rocksdb_snapshot_t.
public sealed class Snapshot : RocksDbHandle, IDisposable
- Inheritance
-
Snapshot
- Implements
- Inherited Members
Remarks
Dispose it as soon as the view is no longer needed. While a snapshot lives, compaction cannot reclaim any version of a key that the snapshot can still see, so a long-lived snapshot grows the database.
It must be released before the database that created it. That ordering is enforced: a snapshot keeps its database reachable, and skips its native release if the database has already been closed.
Properties
SequenceNumber
The sequence number at which this snapshot was taken.
public ulong SequenceNumber { get; }
Property Value
Methods
DisposeHandle()
Releases the native handle. Called during disposal.
protected override void DisposeHandle()
Remarks
Protected rather than public: it destroys the native object without marking this instance disposed or clearing the handle, so calling it from outside and then disposing normally would free the same pointer twice. It was the most Dispose-looking member on the type. Callers want Dispose().