|
|
|
@ -19,7 +19,7 @@ use std::path::Path; |
|
|
|
|
use libc::{self, c_int, c_uchar, c_uint, c_void, size_t, uint64_t}; |
|
|
|
|
|
|
|
|
|
use ffi; |
|
|
|
|
use {BlockBasedOptions, DBCompactionStyle, DBCompressionType, DBRecoveryMode, MemtableFactory, |
|
|
|
|
use {BlockBasedOptions, BlockBasedIndexType, DBCompactionStyle, DBCompressionType, DBRecoveryMode, MemtableFactory, |
|
|
|
|
Options, WriteOptions}; |
|
|
|
|
use compaction_filter::{self, CompactionFilterCallback, CompactionFilterFn, filter_callback}; |
|
|
|
|
use comparator::{self, ComparatorCallback, CompareFn}; |
|
|
|
@ -96,6 +96,24 @@ impl BlockBasedOptions { |
|
|
|
|
ffi::rocksdb_block_based_options_set_cache_index_and_filter_blocks(self.inner, v as u8); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Defines the index type to be used for SS-table lookups.
|
|
|
|
|
///
|
|
|
|
|
/// # Example
|
|
|
|
|
///
|
|
|
|
|
/// ```
|
|
|
|
|
/// use rocksdb::{BlockBasedOptions, BlockBasedIndexType, Options};
|
|
|
|
|
///
|
|
|
|
|
/// let mut opts = Options::default();
|
|
|
|
|
/// let mut block_opts = BlockBasedOptions::default();
|
|
|
|
|
/// block_opts.set_index_type(BlockBasedIndexType::HashSearch);
|
|
|
|
|
/// ```
|
|
|
|
|
pub fn set_index_type(&mut self, index_type: BlockBasedIndexType) { |
|
|
|
|
let index = index_type as i32; |
|
|
|
|
unsafe { |
|
|
|
|
ffi::rocksdb_block_based_options_set_index_type(self.inner, index); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
impl Default for BlockBasedOptions { |
|
|
|
|