summaryrefslogtreecommitdiff
path: root/src/db_options.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db_options.rs')
-rw-r--r--src/db_options.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/db_options.rs b/src/db_options.rs
index 686433b..c3ecc37 100644
--- a/src/db_options.rs
+++ b/src/db_options.rs
@@ -1041,6 +1041,30 @@ impl Options {
}
}
+ /// Number of threads for parallel compression.
+ /// Parallel compression is enabled only if threads > 1.
+ /// THE FEATURE IS STILL EXPERIMENTAL
+ ///
+ /// See [code](https://github.com/facebook/rocksdb/blob/v8.6.7/include/rocksdb/advanced_options.h#L116-L127)
+ /// for more information.
+ ///
+ /// Default: 1
+ ///
+ /// Examples
+ ///
+ /// ```
+ /// use rocksdb::{Options, DBCompressionType};
+ ///
+ /// let mut opts = Options::default();
+ /// opts.set_compression_type(DBCompressionType::Zstd);
+ /// opts.set_compression_options_parallel_threads(3);
+ /// ```
+ pub fn set_compression_options_parallel_threads(&mut self, num: i32) {
+ unsafe {
+ ffi::rocksdb_options_set_compression_options_parallel_threads(self.inner, num);
+ }
+ }
+
/// Sets the bottom-most compression algorithm that will be used for
/// compressing blocks at the bottom-most level.
///