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

Function coordChangeClusterKey

fdbserver/Coordination.actor.cpp:829–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829Future<Void> coordChangeClusterKey(std::string dataFolder, KeyRef newClusterKey, KeyRef oldClusterKey) {
830 TraceEvent(SevInfo, "CoordChangeClusterKey")
831 .detail("DataFolder", dataFolder)
832 .detail("NewClusterKey", newClusterKey)
833 .detail("OldClusterKey", oldClusterKey);
834 std::string absDataFolder = abspath(dataFolder);
835 std::vector<std::string> returnList = platform::listDirectories(absDataFolder);
836 std::vector<Future<Void>> futures;
837 for (const auto& dirEntry : returnList) {
838 if (dirEntry == "." || dirEntry == "..") {
839 continue;
840 }
841 std::string processDir = dataFolder + "/" + dirEntry;
842 TraceEvent(SevInfo, "UpdatingCoordDataForProcess").detail("ProcessDataDir", processDir);
843 std::vector<std::string> returnFiles = platform::listFiles(processDir, "");
844 bool isCoord = false;
845 for (const auto& fileEntry : returnFiles) {
846 if (fileEntry.rfind("coordination-", 0) == 0) {
847 isCoord = true;
848 }
849 }
850 if (!isCoord)
851 continue;
852 futures.push_back(changeClusterDescription(processDir, newClusterKey, oldClusterKey));
853 }
854 return waitForAll(futures);
855}

Callers 1

mainFunction · 0.85

Calls 7

TraceEventClass · 0.85
listDirectoriesFunction · 0.85
listFilesFunction · 0.85
waitForAllFunction · 0.85
detailMethod · 0.80
abspathFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected