| 422 | } |
| 423 | |
| 424 | void 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 | |
| 450 | bool lgraph::SingleLanguagePluginManager::LoadPluginFromCode( |
| 451 | const std::string& user, const std::string& name_, |
no test coverage detected