MCPcopy Create free account
hub / github.com/ByConity/ByConity / loadStoredObjects

Method loadStoredObjects

src/Databases/MySQL/DatabaseMySQL.cpp:416–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416void DatabaseMySQL::loadStoredObjects(ContextMutablePtr, bool, bool /*force_attach*/)
417{
418
419 std::lock_guard<std::mutex> lock{mutex};
420 fs::directory_iterator iter(getMetadataPath());
421
422 for (fs::directory_iterator end; iter != end; ++iter)
423 {
424 if (fs::is_regular_file(iter->path()) && endsWith(iter->path().filename(), suffix))
425 {
426 const auto & filename = iter->path().filename().string();
427 const auto & table_name = unescapeForFileName(filename.substr(0, filename.size() - strlen(suffix)));
428 remove_or_detach_tables.emplace(table_name);
429 }
430 }
431}
432
433void DatabaseMySQL::detachTablePermanently(ContextPtr, const String & table_name)
434{

Callers

nothing calls this directly

Calls 6

unescapeForFileNameFunction · 0.85
endsWithFunction · 0.50
pathMethod · 0.45
stringMethod · 0.45
sizeMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected