MCPcopy Create free account
hub / github.com/Tencent/phxqueue / GetLockIDByAddr

Method GetLockIDByAddr

phxqueue/config/lockconfig.cpp:119–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119comm::RetCode LockConfig::GetLockIDByAddr(const comm::proto::Addr &addr, int &lock_id) const {
120 auto &&encoded_addr = comm::utils::EncodeAddr(addr);
121 auto &&it = impl_->addr2lock_id.find(encoded_addr);
122 if (impl_->addr2lock_id.end() == it) return comm::RetCode::RET_ERR_RANGE_ADDR;
123 lock_id = it->second;
124 return comm::RetCode::RET_OK;
125}
126
127comm::RetCode LockConfig::GetLockByAddr(const comm::proto::Addr &addr, std::shared_ptr<const proto::Lock> &lock) const {
128 comm::RetCode ret;

Callers 3

CheckLockConfigMethod · 0.80
TestLockConfigMethod · 0.80
InitTopicIDMethod · 0.80

Calls 1

EncodeAddrFunction · 0.85

Tested by 2

CheckLockConfigMethod · 0.64
TestLockConfigMethod · 0.64