| 190 | } |
| 191 | |
| 192 | void 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 | |
| 208 | void TabletNodeZkAdapter::OnRootNodeChanged(const std::string& root_tablet_addr) { |
| 209 | LOG(INFO) << "root node is changed"; |
nothing calls this directly
no test coverage detected