| 23 | RowlockProxyImpl::~RowlockProxyImpl() {} |
| 24 | |
| 25 | bool RowlockProxyImpl::Init() { |
| 26 | if (FLAGS_tera_coord_type == "zk") { |
| 27 | zk_adapter_.reset(new RowlockProxyZkAdapter( |
| 28 | this, tera::utils::GetLocalHostName() + ":" + FLAGS_rowlock_proxy_port)); |
| 29 | } else { |
| 30 | zk_adapter_.reset(new InsRowlockProxyZkAdapter( |
| 31 | this, tera::utils::GetLocalHostName() + ":" + FLAGS_rowlock_proxy_port)); |
| 32 | } |
| 33 | |
| 34 | if (!zk_adapter_->Init()) { |
| 35 | LOG(ERROR) << "init zk adapter fail"; |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | LOG(INFO) << "Rowlock node init finish"; |
| 40 | return true; |
| 41 | } |
| 42 | |
| 43 | void RowlockProxyImpl::TryLock(const RowlockRequest* request, RowlockResponse* response, |
| 44 | google::protobuf::Closure* done) { |
no test coverage detected