| 225 | } |
| 226 | |
| 227 | bool 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 | |
| 249 | void NameServerImpl::CheckSyncExistTable(const std::string& alias, |
| 250 | const std::vector<::fedb::nameserver::TableInfo>& tables_remote, |
nothing calls this directly
no test coverage detected