Table of Contents

Class WaitForCompactOptions

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll
public sealed class WaitForCompactOptions : RocksDbHandle, IDisposable
Inheritance
WaitForCompactOptions
Implements
Inherited Members

Constructors

WaitForCompactOptions()

public WaitForCompactOptions()

Properties

AbortOnPause

If true, the wait returns immediately with an error when background work is paused. Defaults to false.

public bool AbortOnPause { get; set; }

Property Value

bool

Remarks

Leaving it false is the trap: if background work is paused and nothing resumes it, queued jobs may never be scheduled and the wait can block forever unless TimeoutMicros is set. Set this to true, or make sure background work is resumed.

CloseDb

If true, the native database is closed once the wait finishes, leaving the RocksDb object unusable.

public bool CloseDb { get; set; }

Property Value

bool

Remarks

Every later call on that RocksDb fails, so treat the wait as the last thing you do with it. The close can also fail without closing, if snapshots are still outstanding, in which case the database stays open.

Flush

If true, every column family is flushed before the wait begins.

public bool Flush { get; set; }

Property Value

bool

TimeoutMicros

Maximum time to wait for compaction, in microseconds. Zero, the default, means wait indefinitely.

public ulong TimeoutMicros { get; set; }

Property Value

ulong

Remarks

Zero is not "do not wait"; it waits for as long as there is background work left. When a non-zero timeout expires the wait fails with a timeout error rather than returning quietly.

WaitForPurge

If true, the wait also covers purging obsolete files, not just finishing compaction, so the database directory is fully settled when it returns.

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