MCPcopy Create free account
hub / github.com/bytedance/terarkdb / LoadOptionsFromFile

Function LoadOptionsFromFile

utilities/options/options_util.cc:15–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14namespace rocksdb {
15Status LoadOptionsFromFile(const std::string& file_name, Env* env,
16 DBOptions* db_options,
17 std::vector<ColumnFamilyDescriptor>* cf_descs,
18 bool ignore_unknown_options) {
19 RocksDBOptionsParser parser;
20 Status s = parser.Parse(file_name, env, ignore_unknown_options);
21 if (!s.ok()) {
22 return s;
23 }
24
25 *db_options = *parser.db_opt();
26
27 const std::vector<std::string>& cf_names = *parser.cf_names();
28 const std::vector<ColumnFamilyOptions>& cf_opts = *parser.cf_opts();
29 cf_descs->clear();
30 for (size_t i = 0; i < cf_opts.size(); ++i) {
31 cf_descs->push_back({cf_names[i], cf_opts[i]});
32 }
33 return Status::OK();
34}
35
36Status GetLatestOptionsFileName(const std::string& dbpath,
37 Env* env, std::string* options_file_name) {

Callers 7

OpenMethod · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
LoadLatestOptionsFunction · 0.85
BloatTestMethod · 0.85

Calls 9

OKFunction · 0.85
db_optMethod · 0.80
cf_namesMethod · 0.80
cf_optsMethod · 0.80
push_backMethod · 0.80
clearMethod · 0.65
ParseMethod · 0.45
okMethod · 0.45
sizeMethod · 0.45

Tested by 3

TEST_FFunction · 0.68
TEST_FFunction · 0.68
BloatTestMethod · 0.68