Table of Contents

Class CompactRangeOptions

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

Options for CompactRange operations.

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

Constructors

CompactRangeOptions()

public CompactRangeOptions()

Properties

AllowWriteStall

Whether the compaction may proceed even if it would stall writes. Default is false, which makes RocksDb wait instead.

public bool AllowWriteStall { get; set; }

Property Value

bool

Remarks

A manual compaction competes with incoming writes for the same write buffers. Left false, RocksDb defers the compaction rather than blocking writers; set true when finishing the compaction matters more than write latency.

BlobGarbageCollectionAgeCutoff

The fraction of the oldest blob files considered for garbage collection, from 0.0 to 1.0. A negative value falls back to the column family setting.

public double BlobGarbageCollectionAgeCutoff { get; set; }

Property Value

double

BlobGarbageCollectionPolicy

Whether this compaction collects blob-file garbage, overriding the column family setting. Defaults to UseDefault.

public BlobGarbageCollectionPolicy BlobGarbageCollectionPolicy { get; set; }

Property Value

BlobGarbageCollectionPolicy

BottommostLevelCompaction

How the bottommost level should be treated during a manual compaction.

public BottommostLevelCompaction BottommostLevelCompaction { get; set; }

Property Value

BottommostLevelCompaction

Remarks

This was a bool over a four-value native setting, and the mapping did not mean what it read like: true selected value 1, which is the default, so it changed nothing, and Force could not be reached at all.

ChangeLevel

If true, allow compaction to change the output level.

public bool ChangeLevel { get; set; }

Property Value

bool

ExclusiveManualCompaction

If true, no other compaction will run at the same time as this one.

public bool ExclusiveManualCompaction { get; set; }

Property Value

bool

MaxSubcompactions

Maximum number of subcompactions for this compaction.

public uint MaxSubcompactions { get; set; }

Property Value

uint

Remarks

Unsigned, matching MaxSubcompactions and the uint32_t RocksDb keeps it in. This was an int, so the same setting had two types in two sibling classes and a negative value reached RocksDb as an enormous one. The C header spells the parameter int, which is why the call casts.

TargetLevel

Target output level for the compacted files.

public int TargetLevel { get; set; }

Property Value

int

TargetPathId

Which of the configured database paths the output is written to, by index. Default is zero, the first path.

public uint TargetPathId { get; set; }

Property Value

uint

Remarks

Only meaningful when several paths are configured through SetDbPaths(IReadOnlyList<DbPath>). It is how a caller moves compacted output onto a chosen device.

An index into that list, so unsigned. It was an int, in which a negative value meant nothing and reached RocksDb as an enormous index.

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