Skip to main content

Module compaction

Module compaction 

Source
Expand description

Inputs to a manual compaction and read only views of what one did.

Two independent halves live here.

CompactionOptions is the owned options object for CompactFiles, the manual compaction entry point that takes an explicit list of input files. It carries the output compression, the output file size limit, the subcompaction count, the trivial move switch, the output temperature override, and an optional CompactionCancellationToken that lets another thread abort the job while it runs.

Everything else is a borrowed view over data RocksDB hands to an event listener: CompactionJobStats, CompactionFileInfo, BlobFileAdditionInfo, and BlobFileGarbageInfo. You never build or own one of these. RocksDB owns the underlying object and it stays alive only as long as the job info it was read from, so the 'a lifetime ties each view and every byte slice it hands back to that borrow.

String-like getters return raw bytes rather than str. RocksDB does not guarantee UTF-8 for key prefixes or file paths, and the slices point straight into the C++ strings, so reading them copies and allocates nothing.

Structsยง

BlobFileAdditionInfo
A blob file created by a flush or compaction, borrowed from the job info that listed it.
BlobFileGarbageInfo
Garbage a compaction produced in an existing blob file, borrowed from the job info that listed it.
CompactionCancellationToken
A cancellation flag that aborts an in progress CompactFiles job.
CompactionFileInfo
One input or output file of a compaction, borrowed from the job info that listed it.
CompactionJobStats
What one compaction job did, borrowed from the event that reported it.
CompactionOptions
Options for a CompactFiles call, which compacts an explicit list of input files.