提交 ac73d755 编写于 作者: I Islam AbdelRahman 提交者: Facebook Github Bot

Add GetSupportedCompressions() convenience function

Summary:
This function will return a list of supported compression types in RocksDB
This is needed for MyRocks https://github.com/facebook/mysql-5.6/pull/446
Closes https://github.com/facebook/rocksdb/pull/1747

Differential Revision: D4385921

Pulled By: IslamAbdelRahman

fbshipit-source-id: 2f5b59f
上级 b104b878
......@@ -288,6 +288,8 @@ Status GetStringFromColumnFamilyOptions(std::string* opts_str,
Status GetStringFromCompressionType(std::string* compression_str,
CompressionType compression_type);
std::vector<CompressionType> GetSupportedCompressions();
Status GetBlockBasedTableOptionsFromString(
const BlockBasedTableOptions& table_options,
const std::string& opts_str,
......
......@@ -1080,6 +1080,17 @@ Status GetStringFromCompressionType(std::string* compression_str,
}
}
std::vector<CompressionType> GetSupportedCompressions() {
std::vector<CompressionType> supported_compressions;
for (const auto& comp_to_name : compression_type_string_map) {
CompressionType t = comp_to_name.second;
if (t != kDisableCompressionOption && CompressionTypeSupported(t)) {
supported_compressions.push_back(t);
}
}
return supported_compressions;
}
bool SerializeSingleBlockBasedTableOption(
std::string* opt_string, const BlockBasedTableOptions& bbt_options,
const std::string& name, const std::string& delimiter) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册