|
|
|
@ -97,6 +97,10 @@ TEST_F(OptionsTest, GetOptionsFromMapTest) { |
|
|
|
|
{"min_partial_merge_operands", "31"}, |
|
|
|
|
{"prefix_extractor", "fixed:31"}, |
|
|
|
|
{"optimize_filters_for_hits", "true"}, |
|
|
|
|
{"enable_blob_files", "true"}, |
|
|
|
|
{"min_blob_size", "1K"}, |
|
|
|
|
{"blob_file_size", "1G"}, |
|
|
|
|
{"blob_compression_type", "kZSTD"}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
std::unordered_map<std::string, std::string> db_options_map = { |
|
|
|
@ -221,6 +225,10 @@ TEST_F(OptionsTest, GetOptionsFromMapTest) { |
|
|
|
|
ASSERT_EQ(new_cf_opt.optimize_filters_for_hits, true); |
|
|
|
|
ASSERT_EQ(std::string(new_cf_opt.prefix_extractor->Name()), |
|
|
|
|
"rocksdb.FixedPrefix.31"); |
|
|
|
|
ASSERT_EQ(new_cf_opt.enable_blob_files, true); |
|
|
|
|
ASSERT_EQ(new_cf_opt.min_blob_size, 1ULL << 10); |
|
|
|
|
ASSERT_EQ(new_cf_opt.blob_file_size, 1ULL << 30); |
|
|
|
|
ASSERT_EQ(new_cf_opt.blob_compression_type, kZSTD); |
|
|
|
|
|
|
|
|
|
cf_options_map["write_buffer_size"] = "hello"; |
|
|
|
|
ASSERT_NOK(GetColumnFamilyOptionsFromMap(exact, base_cf_opt, cf_options_map, |
|
|
|
@ -1445,7 +1453,7 @@ TEST_F(OptionsTest, ConvertOptionsTest) { |
|
|
|
|
// This test suite tests the old APIs into the Configure options methods.
|
|
|
|
|
// Once those APIs are officially deprecated, this test suite can be deleted.
|
|
|
|
|
class OptionsOldApiTest : public testing::Test {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(OptionsOldApiTest, GetOptionsFromMapTest) { |
|
|
|
|
std::unordered_map<std::string, std::string> cf_options_map = { |
|
|
|
|
{"write_buffer_size", "1"}, |
|
|
|
@ -1500,6 +1508,10 @@ TEST_F(OptionsOldApiTest, GetOptionsFromMapTest) { |
|
|
|
|
{"min_partial_merge_operands", "31"}, |
|
|
|
|
{"prefix_extractor", "fixed:31"}, |
|
|
|
|
{"optimize_filters_for_hits", "true"}, |
|
|
|
|
{"enable_blob_files", "true"}, |
|
|
|
|
{"min_blob_size", "1K"}, |
|
|
|
|
{"blob_file_size", "1G"}, |
|
|
|
|
{"blob_compression_type", "kZSTD"}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
std::unordered_map<std::string, std::string> db_options_map = { |
|
|
|
@ -1616,6 +1628,10 @@ TEST_F(OptionsOldApiTest, GetOptionsFromMapTest) { |
|
|
|
|
ASSERT_EQ(new_cf_opt.optimize_filters_for_hits, true); |
|
|
|
|
ASSERT_EQ(std::string(new_cf_opt.prefix_extractor->Name()), |
|
|
|
|
"rocksdb.FixedPrefix.31"); |
|
|
|
|
ASSERT_EQ(new_cf_opt.enable_blob_files, true); |
|
|
|
|
ASSERT_EQ(new_cf_opt.min_blob_size, 1ULL << 10); |
|
|
|
|
ASSERT_EQ(new_cf_opt.blob_file_size, 1ULL << 30); |
|
|
|
|
ASSERT_EQ(new_cf_opt.blob_compression_type, kZSTD); |
|
|
|
|
|
|
|
|
|
cf_options_map["write_buffer_size"] = "hello"; |
|
|
|
|
ASSERT_NOK(GetColumnFamilyOptionsFromMap( |
|
|
|
@ -1910,7 +1926,7 @@ TEST_F(OptionsOldApiTest, GetColumnFamilyOptionsFromStringTest) { |
|
|
|
|
ASSERT_TRUE(new_cf_opt.memtable_factory != nullptr); |
|
|
|
|
ASSERT_EQ(std::string(new_cf_opt.memtable_factory->Name()), "SkipListFactory"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(OptionsOldApiTest, GetBlockBasedTableOptionsFromString) { |
|
|
|
|
BlockBasedTableOptions table_opt; |
|
|
|
|
BlockBasedTableOptions new_opt; |
|
|
|
@ -2085,7 +2101,7 @@ TEST_F(OptionsOldApiTest, GetBlockBasedTableOptionsFromString) { |
|
|
|
|
->GetHighPriPoolRatio(), |
|
|
|
|
0.5); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(OptionsOldApiTest, GetPlainTableOptionsFromString) { |
|
|
|
|
PlainTableOptions table_opt; |
|
|
|
|
PlainTableOptions new_opt; |
|
|
|
@ -2116,7 +2132,7 @@ TEST_F(OptionsOldApiTest, GetPlainTableOptionsFromString) { |
|
|
|
|
"encoding_type=kPrefixXX", |
|
|
|
|
&new_opt)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(OptionsOldApiTest, GetOptionsFromStringTest) { |
|
|
|
|
Options base_options, new_options; |
|
|
|
|
base_options.write_buffer_size = 20; |
|
|
|
@ -2674,7 +2690,7 @@ TEST_F(OptionsParserTest, Readahead) { |
|
|
|
|
uint64_t file_size = 0; |
|
|
|
|
ASSERT_OK(env_->GetFileSize(kOptionsFileName, &file_size)); |
|
|
|
|
assert(file_size > 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RocksDBOptionsParser parser; |
|
|
|
|
|
|
|
|
|
env_->num_seq_file_read_ = 0; |
|
|
|
|