|
|
|
@ -451,13 +451,17 @@ impl Drop for WriteOptions { |
|
|
|
|
|
|
|
|
|
impl Drop for ReadOptions { |
|
|
|
|
fn drop(&mut self) { |
|
|
|
|
unsafe { ffi::rocksdb_readoptions_destroy(self.inner) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_readoptions_destroy(self.inner); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
impl Drop for IngestExternalFileOptions { |
|
|
|
|
fn drop(&mut self) { |
|
|
|
|
unsafe { ffi::rocksdb_ingestexternalfileoptions_destroy(self.inner) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_ingestexternalfileoptions_destroy(self.inner); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -684,7 +688,9 @@ impl BlockBasedOptions { |
|
|
|
|
/// ```
|
|
|
|
|
pub fn set_data_block_index_type(&mut self, index_type: DataBlockIndexType) { |
|
|
|
|
let index_t = index_type as i32; |
|
|
|
|
unsafe { ffi::rocksdb_block_based_options_set_data_block_index_type(self.inner, index_t) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_block_based_options_set_data_block_index_type(self.inner, index_t); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Set the data block hash index utilization ratio.
|
|
|
|
@ -695,7 +701,9 @@ impl BlockBasedOptions { |
|
|
|
|
///
|
|
|
|
|
/// Default: 0.75
|
|
|
|
|
pub fn set_data_block_hash_ratio(&mut self, ratio: f64) { |
|
|
|
|
unsafe { ffi::rocksdb_block_based_options_set_data_block_hash_ratio(self.inner, ratio) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_block_based_options_set_data_block_hash_ratio(self.inner, ratio); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -717,7 +725,9 @@ impl CuckooTableOptions { |
|
|
|
|
/// result in larger hash tables with fewer collisions.
|
|
|
|
|
/// Default: 0.9
|
|
|
|
|
pub fn set_hash_ratio(&mut self, ratio: f64) { |
|
|
|
|
unsafe { ffi::rocksdb_cuckoo_options_set_hash_ratio(self.inner, ratio) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_cuckoo_options_set_hash_ratio(self.inner, ratio); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// A property used by builder to determine the depth to go to
|
|
|
|
@ -727,7 +737,9 @@ impl CuckooTableOptions { |
|
|
|
|
/// lookups but take more time to build.
|
|
|
|
|
/// Default: 100
|
|
|
|
|
pub fn set_max_search_depth(&mut self, depth: u32) { |
|
|
|
|
unsafe { ffi::rocksdb_cuckoo_options_set_max_search_depth(self.inner, depth) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_cuckoo_options_set_max_search_depth(self.inner, depth); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// In case of collision while inserting, the builder
|
|
|
|
@ -737,7 +749,9 @@ impl CuckooTableOptions { |
|
|
|
|
/// of collisions.
|
|
|
|
|
/// Default: 5
|
|
|
|
|
pub fn set_cuckoo_block_size(&mut self, size: u32) { |
|
|
|
|
unsafe { ffi::rocksdb_cuckoo_options_set_cuckoo_block_size(self.inner, size) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_cuckoo_options_set_cuckoo_block_size(self.inner, size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// If this option is enabled, user key is treated as uint64_t and its value
|
|
|
|
@ -747,7 +761,9 @@ impl CuckooTableOptions { |
|
|
|
|
/// Default: false
|
|
|
|
|
pub fn set_identity_as_first_hash(&mut self, flag: bool) { |
|
|
|
|
let v = flag as u8; |
|
|
|
|
unsafe { ffi::rocksdb_cuckoo_options_set_identity_as_first_hash(self.inner, v) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_cuckoo_options_set_identity_as_first_hash(self.inner, v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// If this option is set to true, module is used during hash calculation.
|
|
|
|
@ -757,7 +773,9 @@ impl CuckooTableOptions { |
|
|
|
|
/// Default: true
|
|
|
|
|
pub fn set_use_module_hash(&mut self, flag: bool) { |
|
|
|
|
let v = flag as u8; |
|
|
|
|
unsafe { ffi::rocksdb_cuckoo_options_set_use_module_hash(self.inner, v) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_cuckoo_options_set_use_module_hash(self.inner, v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1006,7 +1024,7 @@ impl Options { |
|
|
|
|
self.inner, |
|
|
|
|
level_types.as_mut_ptr(), |
|
|
|
|
level_types.len() as size_t, |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1231,7 +1249,9 @@ impl Options { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn set_prefix_extractor(&mut self, prefix_extractor: SliceTransform) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_prefix_extractor(self.inner, prefix_extractor.inner) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_prefix_extractor(self.inner, prefix_extractor.inner); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[deprecated(
|
|
|
|
@ -1340,7 +1360,9 @@ impl Options { |
|
|
|
|
/// opts.set_use_fsync(true);
|
|
|
|
|
/// ```
|
|
|
|
|
pub fn set_use_fsync(&mut self, useit: bool) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_use_fsync(self.inner, useit as c_int) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_use_fsync(self.inner, useit as c_int); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Specifies the absolute info LOG dir.
|
|
|
|
@ -1432,7 +1454,7 @@ impl Options { |
|
|
|
|
/// ```
|
|
|
|
|
pub fn set_allow_concurrent_memtable_write(&mut self, allow: bool) { |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_allow_concurrent_memtable_write(self.inner, allow as c_uchar) |
|
|
|
|
ffi::rocksdb_options_set_allow_concurrent_memtable_write(self.inner, allow as c_uchar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1595,7 +1617,7 @@ impl Options { |
|
|
|
|
/// Dynamically changeable through SetOptions() API
|
|
|
|
|
pub fn set_target_file_size_multiplier(&mut self, multiplier: i32) { |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_target_file_size_multiplier(self.inner, multiplier as c_int) |
|
|
|
|
ffi::rocksdb_options_set_target_file_size_multiplier(self.inner, multiplier as c_int); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2045,7 +2067,9 @@ impl Options { |
|
|
|
|
/// opts.set_disable_auto_compactions(true);
|
|
|
|
|
/// ```
|
|
|
|
|
pub fn set_disable_auto_compactions(&mut self, disable: bool) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_disable_auto_compactions(self.inner, disable as c_int) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_disable_auto_compactions(self.inner, disable as c_int); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// SetMemtableHugePageSize sets the page size for huge page for
|
|
|
|
@ -2060,7 +2084,9 @@ impl Options { |
|
|
|
|
///
|
|
|
|
|
/// Dynamically changeable through SetOptions() API
|
|
|
|
|
pub fn set_memtable_huge_page_size(&mut self, size: size_t) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_memtable_huge_page_size(self.inner, size) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_memtable_huge_page_size(self.inner, size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Sets the maximum number of successive merge operations on a key in the memtable.
|
|
|
|
@ -2132,7 +2158,7 @@ impl Options { |
|
|
|
|
self.inner, |
|
|
|
|
level_values.as_ptr() as *mut c_int, |
|
|
|
|
count, |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2149,7 +2175,7 @@ impl Options { |
|
|
|
|
ffi::rocksdb_options_set_skip_checking_sst_file_sizes_on_db_open( |
|
|
|
|
self.inner, |
|
|
|
|
value as c_uchar, |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2184,7 +2210,9 @@ impl Options { |
|
|
|
|
/// be set to the value of 'max_write_buffer_number * write_buffer_size'
|
|
|
|
|
/// if it is not explicitly set by the user. Otherwise, the default is 0.
|
|
|
|
|
pub fn set_max_write_buffer_size_to_maintain(&mut self, size: i64) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_max_write_buffer_size_to_maintain(self.inner, size) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_max_write_buffer_size_to_maintain(self.inner, size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// By default, a single write thread queue is maintained. The thread gets
|
|
|
|
@ -2201,7 +2229,9 @@ impl Options { |
|
|
|
|
///
|
|
|
|
|
/// Default: false
|
|
|
|
|
pub fn set_enable_pipelined_write(&mut self, value: bool) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_enable_pipelined_write(self.inner, value as c_uchar) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_enable_pipelined_write(self.inner, value as c_uchar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Defines the underlying memtable implementation.
|
|
|
|
@ -2439,7 +2469,9 @@ impl Options { |
|
|
|
|
///
|
|
|
|
|
/// Default: `true`
|
|
|
|
|
pub fn set_advise_random_on_open(&mut self, advise: bool) { |
|
|
|
|
unsafe { ffi::rocksdb_options_set_advise_random_on_open(self.inner, advise as c_uchar) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_options_set_advise_random_on_open(self.inner, advise as c_uchar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Specifies the file access pattern once a compaction is started.
|
|
|
|
@ -3110,7 +3142,9 @@ impl ReadOptions { |
|
|
|
|
///
|
|
|
|
|
/// Default: false
|
|
|
|
|
pub fn set_prefix_same_as_start(&mut self, v: bool) { |
|
|
|
|
unsafe { ffi::rocksdb_readoptions_set_prefix_same_as_start(self.inner, v as c_uchar) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_readoptions_set_prefix_same_as_start(self.inner, v as c_uchar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Enable a total order seek regardless of index format (e.g. hash index)
|
|
|
|
@ -3121,7 +3155,9 @@ impl ReadOptions { |
|
|
|
|
/// block based table. It provides a way to read existing data after
|
|
|
|
|
/// changing implementation of prefix extractor.
|
|
|
|
|
pub fn set_total_order_seek(&mut self, v: bool) { |
|
|
|
|
unsafe { ffi::rocksdb_readoptions_set_total_order_seek(self.inner, v as c_uchar) } |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_readoptions_set_total_order_seek(self.inner, v as c_uchar); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Sets a threshold for the number of keys that can be skipped
|
|
|
|
|