MCPcopy Create free account
hub / github.com/ElementsProject/elements / RenameLDBToSST

Method RenameLDBToSST

src/leveldb/db/db_test.cc:516–531  ·  view source on GitHub ↗

Returns number of files renamed.

Source from the content-addressed store, hash-verified

514
515 // Returns number of files renamed.
516 int RenameLDBToSST() {
517 std::vector<std::string> filenames;
518 ASSERT_OK(env_->GetChildren(dbname_, &filenames));
519 uint64_t number;
520 FileType type;
521 int files_renamed = 0;
522 for (size_t i = 0; i < filenames.size(); i++) {
523 if (ParseFileName(filenames[i], &number, &type) && type == kTableFile) {
524 const std::string from = TableFileName(dbname_, number);
525 const std::string to = SSTTableFileName(dbname_, number);
526 ASSERT_OK(env_->RenameFile(from, to));
527 files_renamed++;
528 }
529 }
530 return files_renamed;
531 }
532
533 private:
534 // Sequence of option configurations to try

Callers

nothing calls this directly

Calls 6

ParseFileNameFunction · 0.85
TableFileNameFunction · 0.85
SSTTableFileNameFunction · 0.85
GetChildrenMethod · 0.45
sizeMethod · 0.45
RenameFileMethod · 0.45

Tested by

no test coverage detected