| 174 | */ |
| 175 | |
| 176 | void TabletNodeZkAdapter::OnRootNodeCreated() { |
| 177 | LOG(INFO) << "root node is created"; |
| 178 | // watch root node |
| 179 | int zk_errno = zk::ZE_OK; |
| 180 | bool is_exist = false; |
| 181 | std::string root_tablet_addr; |
| 182 | while (!WatchRootNode(&is_exist, &root_tablet_addr, &zk_errno)) { |
| 183 | LOG(ERROR) << "fail to root node : " << zk::ZkErrnoToString(zk_errno); |
| 184 | ThisThread::Sleep(FLAGS_tera_zk_retry_period); |
| 185 | } |
| 186 | LOG(INFO) << "watch root node success"; |
| 187 | if (!root_tablet_addr.empty()) { |
| 188 | tabletnode_impl_->SetRootTabletAddr(root_tablet_addr); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | void TabletNodeZkAdapter::OnRootNodeDeleted() { |
| 193 | LOG(INFO) << "root node is deleted"; |
nothing calls this directly
no test coverage detected