Table of Contents

Class SizeApproximationOptions

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

Controls what ApproximateSizes(SizeApproximationOptions, IEnumerable<(string Start, string Limit)>) counts when estimating the size of a key range. Maps to rocksdb_size_approximation_options_t.

public sealed class SizeApproximationOptions : RocksDbHandle, IDisposable
Inheritance
SizeApproximationOptions
Implements
Inherited Members

Remarks

Without options RocksDb counts only SST files, so data still sitting in a memtable is invisible to the estimate. Set IncludeMemtables to account for it.

Constructors

SizeApproximationOptions()

public SizeApproximationOptions()

Properties

FilesSizeErrorMargin

How much error RocksDb may accept in the file-size portion of the estimate, as a fraction. A larger margin lets it answer with less I/O.

public double FilesSizeErrorMargin { get; set; }

Property Value

double

IncludeBlobFiles

If true, blob files count toward the estimate.

public bool IncludeBlobFiles { get; set; }

Property Value

bool

IncludeFiles

If true, SST files count toward the estimate. On by default.

public bool IncludeFiles { get; set; }

Property Value

bool

IncludeMemtables

If true, data still in memtables counts toward the estimate. Off by default, which is why a freshly written range can estimate as zero.

public bool IncludeMemtables { get; set; }

Property Value

bool

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().