Table of Contents

Class FifoCompactionOptions

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

Tuning for FIFO compaction. Maps to rocksdb_fifo_compaction_options_t.

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

Remarks

Only used when CompactionStyle is Fifo. FIFO keeps a bounded amount of the most recent data and drops the oldest, which suits time-series and logs, so MaxTableFilesSize is what determines retention.

Attach with FifoCompactionOptions. RocksDb copies the values, so this object may be disposed immediately afterwards.

Constructors

FifoCompactionOptions()

Creates options with RocksDb's defaults.

public FifoCompactionOptions()

Properties

AgeForWarm

Age in seconds after which a file is moved to warm storage, or zero to disable.

public ulong AgeForWarm { get; set; }

Property Value

ulong

Remarks

Works with Temperature-aware storage: old files are marked so that a tiered filesystem can move them off fast media.

AllowCompaction

Whether small files may be compacted together rather than only dropped.

public bool AllowCompaction { get; set; }

Property Value

bool

Remarks

Off by default, because FIFO's appeal is that it does almost no compaction work. Enabling it reduces the file count at the cost of some write amplification.

AllowTrivialCopyWhenChangeTemperature

Whether a temperature change may copy a file rather than rewriting it.

public bool AllowTrivialCopyWhenChangeTemperature { get; set; }

Property Value

bool

MaxDataFilesSize

Total size of data files to retain, in bytes.

public ulong MaxDataFilesSize { get; set; }

Property Value

ulong

MaxTableFilesSize

Total size of table files to retain, in bytes. Once exceeded, the oldest files are dropped.

public ulong MaxTableFilesSize { get; set; }

Property Value

ulong

Remarks

The retention control. Data is deleted rather than compacted away, so this is a hard bound on how much history the database keeps.

TrivialCopyBufferSize

Buffer size used for such a copy, in bytes.

public ulong TrivialCopyBufferSize { get; set; }

Property Value

ulong

UseKvRatioCompaction

Whether compaction is driven by the ratio of keys to values rather than by size alone.

public bool UseKvRatioCompaction { 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().