Class CompactionCancellationFlag
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
A flag a running CompactFiles(CompactFilesOptions?, IReadOnlyList<string>, int, int)
polls so it can be stopped from another thread.
Maps to the rocksdb_compaction_options_canceled_* functions.
public sealed class CompactionCancellationFlag : IDisposable
- Inheritance
-
CompactionCancellationFlag
- Implements
- Inherited Members
Remarks
The native object is a std::atomic<bool> that the C API hands
back as an unsigned char*. It is deliberately opaque here: reading the
byte directly would be a non-atomic read of an atomic, so this type only
writes to it.
CompactFilesOptions stores the raw pointer without taking
ownership, so this object must outlive every compaction that references it.
Set CancellationFlag back to null
before disposing it if the options are still in use.
Constructors
CompactionCancellationFlag()
public CompactionCancellationFlag()
Properties
IsDisposed
Whether this flag has been released.
public bool IsDisposed { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~CompactionCancellationFlag()
protected ~CompactionCancellationFlag()
Set(bool)
Requests cancellation of any compaction using this flag, or clears a previous request.
public void Set(bool canceled)
Parameters
canceledbool
Remarks
A cancelled compaction fails with a RocksDbException rather than returning a partial result.