Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allow_ingest_behind ffi call for DB Options #808

Merged
merged 7 commits into from
Aug 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/db_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3056,6 +3056,25 @@ impl Options {
ffi::rocksdb_options_set_blob_compaction_readahead_size(self.inner, val);
}
}

/// Set this option to true during creation of database if you want
/// to be able to ingest behind (call IngestExternalFile() skipping keys
/// that already exist, rather than overwriting matching keys).
/// Setting this option to true has the following effects:
/// 1) Disable some internal optimizations around SST file compression.
/// 2) Reserve the last level for ingested files only.
/// 3) Compaction will not include any file from the last level.
/// Note that only Universal Compaction supports allow_ingest_behind.
/// `num_levels` should be >= 3 if this option is turned on.
///
/// DEFAULT: false
/// Immutable.
pub fn set_allow_ingest_behind(&mut self, val: bool) {
unsafe {
ffi::rocksdb_options_set_allow_ingest_behind(self.inner, c_uchar::from(val));
}
}

}

impl Default for Options {
Expand Down