Skip to content

Commit

Permalink
add period-compaction interface
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyazhou committed Jan 4, 2024
1 parent 6dd1f58 commit 1791ec8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/db_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,12 @@ impl Options {
}
}

pub fn set_periodic_compaction_seconds(&mut self, sec: u64) {
unsafe {
ffi::rocksdb_options_set_periodic_compaction_seconds(self.inner, sec);
}
}

/// If true, the database will be created if it is missing.
///
/// Default: `false`
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ mod db_iterator;
mod db_options;
mod db_pinnable_slice;
mod env;
mod event_listener;
mod iter_range;
pub mod merge_operator;
pub mod perf;
Expand All @@ -95,7 +96,6 @@ mod snapshot;
mod sst_file_writer;
mod transactions;
mod write_batch;
mod event_listener;

pub use crate::{
column_family::{
Expand All @@ -120,6 +120,7 @@ pub use crate::{
},
db_pinnable_slice::DBPinnableSlice,
env::Env,
event_listener::{EventListener, FlushJobInfo},
ffi_util::CStrLike,
iter_range::{IterateBounds, PrefixRange},
merge_operator::MergeOperands,
Expand All @@ -132,7 +133,6 @@ pub use crate::{
TransactionDBOptions, TransactionOptions,
},
write_batch::{WriteBatch, WriteBatchIterator, WriteBatchWithTransaction},
event_listener::{EventListener, FlushJobInfo},
};

use haizhi_librocksdb_sys as ffi;
Expand Down

0 comments on commit 1791ec8

Please sign in to comment.