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

Method addExternalLibraryDirectory

fdbclient/MultiVersionTransaction.actor.cpp:2297–2316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2295}
2296
2297void MultiVersionApi::addExternalLibraryDirectory(std::string path) {
2298 TraceEvent("AddingExternalClientDirectory").detail("Directory", path);
2299 std::vector<std::string> files = platform::listFiles(path, DYNAMIC_LIB_EXT);
2300
2301 MutexHolder holder(lock);
2302 if (networkStartSetup) {
2303 throw invalid_option(); // SOMEDAY: it might be good to allow clients to be added after the network is setup
2304 }
2305
2306 // external libraries always run on their own thread; ensure we allocate at least one thread to run this library.
2307 threadCount = std::max(threadCount, 1);
2308
2309 for (auto filename : files) {
2310 std::string lib = abspath(joinPath(path, filename));
2311 if (externalClientDescriptions.count(filename) == 0) {
2312 TraceEvent("AddingExternalClient").detail("LibraryPath", filename);
2313 externalClientDescriptions.emplace(std::make_pair(filename, ClientDesc(lib, true, false)));
2314 }
2315 }
2316}
2317#if defined(__unixish__)
2318std::vector<std::pair<std::string, bool>> MultiVersionApi::copyExternalLibraryPerThread(std::string path) {
2319 ASSERT_GE(threadCount, 1);

Callers

nothing calls this directly

Calls 7

TraceEventClass · 0.85
listFilesFunction · 0.85
ClientDescClass · 0.85
detailMethod · 0.80
countMethod · 0.65
abspathFunction · 0.50
joinPathFunction · 0.50

Tested by

no test coverage detected