Class LiveFileMetadata
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
Metadata for a single live SST file in the database.
public sealed record LiveFileMetadata : IEquatable<LiveFileMetadata>
- Inheritance
-
LiveFileMetadata
- Implements
- Inherited Members
Remarks
A snapshot, read in full before it is handed over, so it needs no disposal and can be kept and passed around freely. It used to read through its parent on every property access, which meant an instance was only valid while that parent was alive. See the ownership guide for why this library copies rather than lending.
Constructors
LiveFileMetadata(string, string, int, ulong, byte[]?, byte[]?, ulong, ulong, ulong, ulong)
Metadata for a single live SST file in the database.
public LiveFileMetadata(string Name, string Directory, int Level, ulong Size, byte[]? SmallestKey, byte[]? LargestKey, ulong SmallestSequenceNumber, ulong LargestSequenceNumber, ulong Entries, ulong Deletions)
Parameters
NamestringThe SST file name, without a directory part.
DirectorystringThe directory holding the file, which is not always the database directory when several paths are configured.
LevelintThe LSM level the file sits at. Zero is the newest level, written directly by flushes, and higher numbers hold older, larger, compacted data.
SizeulongThe file size in bytes.
SmallestKeybyte[]The lowest key in the file, or null if RocksDb reported none.
LargestKeybyte[]The highest key in the file, or null if RocksDb reported none.
SmallestSequenceNumberulongThe lowest sequence number in the file. With
LargestSequenceNumberthis bounds when the file's writes happened relative to the rest of the database.LargestSequenceNumberulongThe highest sequence number in the file.
EntriesulongHow many entries the file holds, counting tombstones as entries. Subtract
Deletionsfor a rough live-key count.DeletionsulongHow many of the file's entries are tombstones. A file that is mostly tombstones is a candidate for compaction, since every read across its key range has to walk them.
Remarks
A snapshot, read in full before it is handed over, so it needs no disposal and can be kept and passed around freely. It used to read through its parent on every property access, which meant an instance was only valid while that parent was alive. See the ownership guide for why this library copies rather than lending.
Properties
Deletions
How many of the file's entries are tombstones. A file that is mostly tombstones is a candidate for compaction, since every read across its key range has to walk them.
public ulong Deletions { get; init; }
Property Value
Directory
The directory holding the file, which is not always the database directory when several paths are configured.
public string Directory { get; init; }
Property Value
Entries
How many entries the file holds, counting tombstones as entries. Subtract
Deletions for a rough live-key count.
public ulong Entries { get; init; }
Property Value
LargestKey
The highest key in the file, or null if RocksDb reported none.
public byte[]? LargestKey { get; init; }
Property Value
- byte[]
LargestSequenceNumber
The highest sequence number in the file.
public ulong LargestSequenceNumber { get; init; }
Property Value
Level
The LSM level the file sits at. Zero is the newest level, written directly by flushes, and higher numbers hold older, larger, compacted data.
public int Level { get; init; }
Property Value
Name
The SST file name, without a directory part.
public string Name { get; init; }
Property Value
Size
The file size in bytes.
public ulong Size { get; init; }
Property Value
SmallestKey
The lowest key in the file, or null if RocksDb reported none.
public byte[]? SmallestKey { get; init; }
Property Value
- byte[]
SmallestSequenceNumber
The lowest sequence number in the file. With
LargestSequenceNumber this bounds when the file's writes
happened relative to the rest of the database.
public ulong SmallestSequenceNumber { get; init; }