From 620823f88b8402f99087420a805fc1eab0256d9e Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Thu, 22 Mar 2018 15:09:55 -0700 Subject: [PATCH] parse CompressionOptions::zstd_max_train_bytes in options string Summary: Closes https://github.com/facebook/rocksdb/pull/3588 Differential Revision: D7208087 Pulled By: ajkr fbshipit-source-id: 688f7a7c447cb17bee1b410d1fd891c0bf966617 --- options/options_helper.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/options/options_helper.cc b/options/options_helper.cc index b93f3454b..afcad5bf4 100644 --- a/options/options_helper.cc +++ b/options/options_helper.cc @@ -919,6 +919,17 @@ Status ParseColumnFamilyOption(const std::string& name, } new_options->compression_opts.max_dict_bytes = ParseInt(value.substr(start, value.size() - start)); + end = value.find(':', start); + } + // zstd_max_train_bytes is optional for backwards compatibility + if (end != std::string::npos) { + start = end + 1; + if (start >= value.size()) { + return Status::InvalidArgument( + "unable to parse the specified CF option " + name); + } + new_options->compression_opts.zstd_max_train_bytes = + ParseInt(value.substr(start, value.size() - start)); } } else { auto iter = cf_options_type_info.find(name);