Skip to content

Add C API bindings for DB::CompactFiles (fixes #11915)#14390

Open
lihasgupta wants to merge 3 commits intofacebook:mainfrom
lihasgupta:c-api-compact-files
Open

Add C API bindings for DB::CompactFiles (fixes #11915)#14390
lihasgupta wants to merge 3 commits intofacebook:mainfrom
lihasgupta:c-api-compact-files

Conversation

@lihasgupta
Copy link

RocksDB's C++ API has DB::CompactFiles(), which compacts a caller-specified set of SST files into a target level. The C API had no equivalent, making this operation inaccessible from C programs.

rocksdb_compaction_options_t
A new opaque struct wrapping CompactionOptions. It is distinct from the existing rocksdb_compactoptions_t, which wraps CompactRangeOptions and is used by rocksdb_compact_range*.

  • rocksdb_compaction_options_create()
  • rocksdb_compaction_options_destroy()
  • rocksdb_compaction_options_set/get_compression()
  • rocksdb_compaction_options_set/get_output_file_size_limit()
  • rocksdb_compaction_options_set/get_max_subcompactions()
  • rocksdb_compaction_options_set/get_allow_trivial_move()
  • OMITTED canceled: requires std::atomic*, not C-safe
  • OMITTED output_temperature_override: Temperature enum is internal

rocksdb_compact_files()
Compacts the given input files into the target level using the default column family.

rocksdb_compact_files_cf()
Same, but with an explicit column family handle

@meta-cla meta-cla bot added the CLA Signed label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant