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

Method Init

src/observer/rowlockproxy/rowlock_proxy_impl.cc:25–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23RowlockProxyImpl::~RowlockProxyImpl() {}
24
25bool 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
43void RowlockProxyImpl::TryLock(const RowlockRequest* request, RowlockResponse* response,
44 google::protobuf::Closure* done) {

Callers 1

StartServerMethod · 0.45

Calls 2

GetLocalHostNameFunction · 0.85
resetMethod · 0.45

Tested by

no test coverage detected