MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / registerExistingModules

Method registerExistingModules

src/Interpreters/WasmModuleManager.cpp:323–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323void WasmModuleManager::registerExistingModules()
324{
325 UniqueLock lock(modules_mutex);
326 LOG_DEBUG(log, "Loading WASM modules from '{}/{}' at disk '{}'", user_scripts_disk->getPath(), user_scripts_path, user_scripts_disk->getName());
327
328 auto files_it = user_scripts_disk->iterateDirectory(user_scripts_path);
329 for (; files_it->isValid(); files_it->next())
330 {
331 const auto & file_path = files_it->path();
332 const auto & file_name = files_it->name();
333 auto res = validateModuleFile(user_scripts_disk, file_path);
334 if (!res)
335 {
336 LOG_DEBUG(log, "Ignoring file '{}' which is not a valid WASM module: {}", file_path, res.error().text);
337 continue;
338 }
339
340 auto [_, inserted] = modules.insert({res.value(), {}});
341 if (!inserted)
342 {
343 LOG_DEBUG(log, "Ignoring file '{}' with duplicate module name", file_path);
344 continue;
345 }
346 }
347
348 LOG_DEBUG(log, "Found {} WASM modules", modules.size());
349}
350
351std::string WasmModuleManager::getFilePath(std::string_view module_name) const
352{

Callers

nothing calls this directly

Calls 12

validateModuleFileFunction · 0.85
getPathMethod · 0.45
getNameMethod · 0.45
iterateDirectoryMethod · 0.45
isValidMethod · 0.45
nextMethod · 0.45
pathMethod · 0.45
nameMethod · 0.45
errorMethod · 0.45
insertMethod · 0.45
valueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected