Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions v8/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions v8/options_block_based_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}