MCPcopy Create free account
hub / github.com/TuGraph-family/tugraph-db / LoadPlugin

Method LoadPlugin

src/plugin/plugin_manager.cpp:424–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void lgraph::SingleLanguagePluginManager::LoadPlugin(const std::string& user, KvTransaction& txn,
425 const std::string& name,
426 const std::string& exe,
427 const std::string& desc, bool read_only,
428 const std::string& version) {
429 std::string plugin_path = impl_->GetPluginPath(name);
430 // write so
431 WriteWholeFile(plugin_path, exe, "plugin binary file");
432
433 // load dll
434 std::unique_ptr<PluginInfoBase> pinfo_(impl_->CreatePluginInfo());
435 PluginInfoBase* pinfo = pinfo_.get();
436 pinfo->language = language_;
437 pinfo->desc = desc;
438 pinfo->read_only = read_only;
439 pinfo->version = version;
440 impl_->LoadPlugin(user, name, pinfo);
441 procedures_.emplace(name, pinfo_.release());
442
443 // update kv and memory status
444 fma_common::BinaryBuffer info;
445 fma_common::BinaryWrite(info, *pinfo);
446 UpdateInfoToKvStore(txn, name, info);
447 UpdateSoToKvStore(txn, name, exe);
448}
449
450bool lgraph::SingleLanguagePluginManager::LoadPluginFromCode(
451 const std::string& user, const std::string& name_,

Callers 2

DelPluginMethod · 0.45
LoadAllPluginsMethod · 0.45

Calls 6

WriteWholeFileFunction · 0.85
BinaryWriteFunction · 0.70
GetPluginPathMethod · 0.45
CreatePluginInfoMethod · 0.45
getMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected