MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / UpdateRemoteRealEpMap

Method UpdateRemoteRealEpMap

src/nameserver/name_server_impl.cc:227–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool ClusterInfo::UpdateRemoteRealEpMap() {
228 if (!FLAGS_use_name) {
229 return true;
230 }
231 decltype(remote_real_ep_map_) tmp_map = std::make_shared<std::map<std::string, std::string>>();
232 std::vector<std::string> vec;
233 if (!zk_client_->GetChildren(cluster_add_.zk_path() + "/map/names", vec) || vec.empty()) {
234 PDLOG(WARNING, "get zk failed, get remote children");
235 return false;
236 }
237 for (const auto& ep : vec) {
238 std::string real_endpoint;
239 if (!zk_client_->GetNodeValue(cluster_add_.zk_path() + "/map/names/" + ep, real_endpoint)) {
240 PDLOG(WARNING, "get zk failed, get real_endpoint failed");
241 continue;
242 }
243 tmp_map->insert(std::make_pair(ep, real_endpoint));
244 }
245 std::atomic_store_explicit(&remote_real_ep_map_, tmp_map, std::memory_order_release);
246 return true;
247}
248
249void NameServerImpl::CheckSyncExistTable(const std::string& alias,
250 const std::vector<::fedb::nameserver::TableInfo>& tables_remote,

Callers

nothing calls this directly

Calls 5

GetChildrenMethod · 0.80
GetNodeValueMethod · 0.80
insertMethod · 0.80
AddTaskMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected