MCPcopy Create free account
hub / github.com/baidu/tera / OnRootNodeDeleted

Method OnRootNodeDeleted

src/tabletnode/tabletnode_zk_adapter.cc:192–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void TabletNodeZkAdapter::OnRootNodeDeleted() {
193 LOG(INFO) << "root node is deleted";
194 // watch root node
195 int zk_errno = zk::ZE_OK;
196 bool is_exist = false;
197 std::string root_tablet_addr;
198 while (!WatchRootNode(&is_exist, &root_tablet_addr, &zk_errno)) {
199 LOG(ERROR) << "fail to root node : " << zk::ZkErrnoToString(zk_errno);
200 ThisThread::Sleep(FLAGS_tera_zk_retry_period);
201 }
202 LOG(INFO) << "watch root node success";
203 if (!root_tablet_addr.empty()) {
204 tabletnode_impl_->SetRootTabletAddr(root_tablet_addr);
205 }
206}
207
208void TabletNodeZkAdapter::OnRootNodeChanged(const std::string& root_tablet_addr) {
209 LOG(INFO) << "root node is changed";

Callers

nothing calls this directly

Calls 3

ZkErrnoToStringFunction · 0.85
SetRootTabletAddrMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected