MCPcopy Create free account
hub / github.com/apple/foundationdb / restoreRoleFilesHelper

Function restoreRoleFilesHelper

fdbserver/fdbserver.actor.cpp:988–999  ·  view source on GitHub ↗

moves files from 'dirSrc' to 'dirToMove' if their name contains 'role'

Source from the content-addressed store, hash-verified

986
987// moves files from 'dirSrc' to 'dirToMove' if their name contains 'role'
988void restoreRoleFilesHelper(std::string dirSrc, std::string dirToMove, std::string role) {
989 std::vector<std::string> returnFiles = platform::listFiles(dirSrc, "");
990 for (const auto& fileEntry : returnFiles) {
991 if (fileEntry != "fdb.cluster" && fileEntry.find(role) != std::string::npos) {
992 // rename files
993 TraceEvent("RenamingSnapFile")
994 .detail("Oldname", dirSrc + "/" + fileEntry)
995 .detail("Newname", dirToMove + "/" + fileEntry);
996 renameFile(dirSrc + "/" + fileEntry, dirToMove + "/" + fileEntry);
997 }
998 }
999}
1000
1001namespace {
1002enum class ServerRole {

Callers 1

mainFunction · 0.85

Calls 5

listFilesFunction · 0.85
TraceEventClass · 0.85
renameFileFunction · 0.85
detailMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected