Class TablePropertiesView
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
A read-only window onto an SST file's properties, valid only for the duration of the callback it was handed to.
public sealed class TablePropertiesView
- Inheritance
-
TablePropertiesView
- Inherited Members
Remarks
This exists for SetTableFilter(Func<TablePropertiesView, bool>), which RocksDb invokes once per SST file per read. Copying all 58 properties on every one of those calls would be wasteful when a filter typically looks at one or two, so this reads each value straight from the native structure instead.
The cost of that is lifetime: the underlying pointer belongs to RocksDb and dies when the callback returns. Using the view after that throws InvalidOperationException rather than reading freed memory. To keep the data, call ToSnapshot() while the view is still live.
Only the properties a filter is likely to want are exposed directly. ToSnapshot() gives the full set.
Properties
ColumnFamilyId
Identifier of the column family this file belongs to.
public ulong ColumnFamilyId { get; }
Property Value
ColumnFamilyName
Name of the column family this file belongs to.
public string? ColumnFamilyName { get; }
Property Value
CreationTime
Unix timestamp at which the oldest data in this file was written, or 0 if unknown.
public ulong CreationTime { get; }
Property Value
DataSize
Total size of all data blocks, in bytes.
public ulong DataSize { get; }
Property Value
FileCreationTime
Unix timestamp at which this file was created, or 0 if unknown.
public ulong FileCreationTime { get; }
Property Value
HasKeyLargestSeqno
Whether KeyLargestSeqno holds a meaningful value.
public bool HasKeyLargestSeqno { get; }
Property Value
HasKeySmallestSeqno
Whether KeySmallestSeqno holds a meaningful value.
public bool HasKeySmallestSeqno { get; }
Property Value
IsValid
Whether the view still refers to live table properties.
public bool IsValid { get; }
Property Value
KeyLargestSeqno
The largest sequence number in the file. Only meaningful when
HasKeyLargestSeqno is true.
public ulong KeyLargestSeqno { get; }
Property Value
KeySmallestSeqno
The smallest sequence number in the file. Only meaningful when
HasKeySmallestSeqno is true.
public ulong KeySmallestSeqno { get; }
Property Value
NewestKeyTime
Unix timestamp of the newest key in this file, or 0 if unknown.
public ulong NewestKeyTime { get; }
Property Value
NumDeletions
Number of deletion entries (tombstones) in the file.
public ulong NumDeletions { get; }
Property Value
NumEntries
Number of entries in the file, including deletions and merge operands.
public ulong NumEntries { get; }
Property Value
NumMergeOperands
Number of merge operands in the file.
public ulong NumMergeOperands { get; }
Property Value
NumRangeDeletions
Number of range-deletion entries in the file.
public ulong NumRangeDeletions { get; }
Property Value
OldestKeyTime
Unix timestamp of the oldest key in this file, or 0 if unknown.
public ulong OldestKeyTime { get; }
Property Value
RawKeySize
Total size of all keys before compression or encoding, in bytes.
public ulong RawKeySize { get; }
Property Value
RawValueSize
Total size of all values before compression or encoding, in bytes.
public ulong RawValueSize { get; }
Property Value
Methods
ToSnapshot()
Copies every property into a TableProperties that outlives the callback. Call this only while the view is valid.
public TableProperties ToSnapshot()