Table of Contents

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

ulong

ColumnFamilyName

Name of the column family this file belongs to.

public string? ColumnFamilyName { get; }

Property Value

string

CreationTime

Unix timestamp at which the oldest data in this file was written, or 0 if unknown.

public ulong CreationTime { get; }

Property Value

ulong

DataSize

Total size of all data blocks, in bytes.

public ulong DataSize { get; }

Property Value

ulong

FileCreationTime

Unix timestamp at which this file was created, or 0 if unknown.

public ulong FileCreationTime { get; }

Property Value

ulong

HasKeyLargestSeqno

Whether KeyLargestSeqno holds a meaningful value.

public bool HasKeyLargestSeqno { get; }

Property Value

bool

HasKeySmallestSeqno

Whether KeySmallestSeqno holds a meaningful value.

public bool HasKeySmallestSeqno { get; }

Property Value

bool

IsValid

Whether the view still refers to live table properties.

public bool IsValid { get; }

Property Value

bool

KeyLargestSeqno

The largest sequence number in the file. Only meaningful when HasKeyLargestSeqno is true.

public ulong KeyLargestSeqno { get; }

Property Value

ulong

KeySmallestSeqno

The smallest sequence number in the file. Only meaningful when HasKeySmallestSeqno is true.

public ulong KeySmallestSeqno { get; }

Property Value

ulong

NewestKeyTime

Unix timestamp of the newest key in this file, or 0 if unknown.

public ulong NewestKeyTime { get; }

Property Value

ulong

NumDeletions

Number of deletion entries (tombstones) in the file.

public ulong NumDeletions { get; }

Property Value

ulong

NumEntries

Number of entries in the file, including deletions and merge operands.

public ulong NumEntries { get; }

Property Value

ulong

NumMergeOperands

Number of merge operands in the file.

public ulong NumMergeOperands { get; }

Property Value

ulong

NumRangeDeletions

Number of range-deletion entries in the file.

public ulong NumRangeDeletions { get; }

Property Value

ulong

OldestKeyTime

Unix timestamp of the oldest key in this file, or 0 if unknown.

public ulong OldestKeyTime { get; }

Property Value

ulong

RawKeySize

Total size of all keys before compression or encoding, in bytes.

public ulong RawKeySize { get; }

Property Value

ulong

RawValueSize

Total size of all values before compression or encoding, in bytes.

public ulong RawValueSize { get; }

Property Value

ulong

Methods

ToSnapshot()

Copies every property into a TableProperties that outlives the callback. Call this only while the view is valid.

public TableProperties ToSnapshot()

Returns

TableProperties