diff options
author | Zaidoon Abd Al Hadi <43054535+zaidoon1@users.noreply.github.com> | 2023-10-25 15:49:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 20:49:13 +0100 |
commit | 266571ec5793dc4ab5b524f7fed7c91519aa0fe5 (patch) | |
tree | c81d71ce2f76a9a2b87b6cf7582c75d85c70a509 | |
parent | a6f7a7cf17d253bbb62e144ce86782e8686beddc (diff) |
feat: expose compression option parallel_threads (#828)
Co-authored-by: zaidoon <zaidoon@cloudflare.com>
-rw-r--r-- | src/db_options.rs | 24 |
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. /// |