Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add BottommostCompressionOptionsZstdDictTrainer option #101

Merged
merged 1 commit into from
Jan 20, 2023
Merged
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
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