diff --git a/v8/options.go b/v8/options.go index c3a8981..f9a5e54 100644 --- a/v8/options.go +++ b/v8/options.go @@ -1043,6 +1043,17 @@ func (opts *Options) SetDumpMallocStats(value bool) { C.rocksdb_options_set_dump_malloc_stats(opts.c, boolToChar(value)) } +// SetMemtableWholeKeyFiltering enable whole key bloom filter in memtable. Note this will only take effect +// if memtable_prefix_bloom_size_ratio is not 0. Enabling whole key filtering +// can potentially reduce CPU usage for point-look-ups. +// +// Default: false (disable) +// +// Dynamically changeable through SetOptions() API +func (opts *Options) SetMemtableWholeKeyFiltering(value bool) { + C.rocksdb_options_set_memtable_whole_key_filtering(opts.c, boolToChar(value)) +} + // EnableStatistics enable statistics. func (opts *Options) EnableStatistics() { C.rocksdb_options_enable_statistics(opts.c) diff --git a/v8/options_block_based_table.go b/v8/options_block_based_table.go index 8ee5335..e5524d3 100644 --- a/v8/options_block_based_table.go +++ b/v8/options_block_based_table.go @@ -18,6 +18,16 @@ const ( KTwoLevelIndexSearchIndexType = 2 ) +// DataBlockIndexType specifies index type that will be used for the data block. +type DataBlockIndexType uint + +const ( + // KDataBlockIndexTypeBinarySearch is traditional block type + KDataBlockIndexTypeBinarySearch DataBlockIndexType = 0 + // KDataBlockIndexTypeBinarySearchAndHash additional hash index + KDataBlockIndexTypeBinarySearchAndHash DataBlockIndexType = 1 +) + // BlockBasedTableOptions represents block-based table options. type BlockBasedTableOptions struct { c *C.rocksdb_block_based_table_options_t @@ -222,3 +232,16 @@ func (opts *BlockBasedTableOptions) SetFormatVersion(version int) { func (opts *BlockBasedTableOptions) SetIndexType(value IndexType) { C.rocksdb_block_based_options_set_index_type(opts.c, C.int(value)) } + +// SetDataBlockIndexType sets data block index type +func (opts *BlockBasedTableOptions) SetDataBlockIndexType(value DataBlockIndexType) { + C.rocksdb_block_based_options_set_data_block_index_type(opts.c, C.int(value)) +} + +// SetDataBlockHashRatio is valid only when data_block_hash_index_type is +// KDataBlockIndexTypeBinarySearchAndHash. +// +// Default value: 0.75 +func (opts *BlockBasedTableOptions) SetDataBlockHashRatio(value float64) { + C.rocksdb_block_based_options_set_data_block_hash_ratio(opts.c, C.double(value)) +}