Skip to content

Commit

Permalink
add BottommostCompressionOptionsZstdDictTrainer option
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Jan 12, 2023
1 parent b3ad4ec commit dedac66
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,27 +714,27 @@ func (opts *Options) SetBottommostCompressionOptionsMaxDictBufferBytes(value uin
)
}

// // SetBottommostCompressionOptionsZstdDictTrainer uses/not use zstd trainer to generate dictionaries.
// // When this option is set to true, zstd_max_train_bytes of training data sampled from
// // max_dict_buffer_bytes buffered data will be passed to zstd dictionary trainer to generate a
// // dictionary of size max_dict_bytes.
// //
// // When this option is false, zstd's API ZDICT_finalizeDictionary() will be
// // called to generate dictionaries. zstd_max_train_bytes of training sampled
// // data will be passed to this API. Using this API should save CPU time on
// // dictionary training, but the compression ratio may not be as good as using
// // a dictionary trainer.
// //
// // Default: true
// func (opts *Options) SetBottommostCompressionOptionsZstdDictTrainer(enabled bool) {
// c := boolToChar(enabled)
// C.rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer(opts.c, c, c)
// }

// // GetBottommostCompressionOptionsZstdDictTrainer returns if zstd dict trainer is used or not.
// func (opts *Options) GetBottommostCompressionOptionsZstdDictTrainer() bool {
// return charToBool(C.rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer(opts.c))
// }
// SetBottommostCompressionOptionsZstdDictTrainer uses/not use zstd trainer to generate dictionaries.
// When this option is set to true, zstd_max_train_bytes of training data sampled from
// max_dict_buffer_bytes buffered data will be passed to zstd dictionary trainer to generate a
// dictionary of size max_dict_bytes.
//
// When this option is false, zstd's API ZDICT_finalizeDictionary() will be
// called to generate dictionaries. zstd_max_train_bytes of training sampled
// data will be passed to this API. Using this API should save CPU time on
// dictionary training, but the compression ratio may not be as good as using
// a dictionary trainer.
//
// Default: true
func (opts *Options) SetBottommostCompressionOptionsZstdDictTrainer(enabled bool) {
c := boolToChar(enabled)
C.rocksdb_options_set_bottommost_compression_options_use_zstd_dict_trainer(opts.c, c, c)
}

// GetBottommostCompressionOptionsZstdDictTrainer returns if zstd dict trainer is used or not.
func (opts *Options) GetBottommostCompressionOptionsZstdDictTrainer() bool {
return charToBool(C.rocksdb_options_get_bottommost_compression_options_use_zstd_dict_trainer(opts.c))
}

// SetMinLevelToCompress sets the start level to use compression.
func (opts *Options) SetMinLevelToCompress(value int) {
Expand Down

0 comments on commit dedac66

Please sign in to comment.