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

Method ReadRestartCheckpoint

phxqueue/lock/lockmgr.cpp:229–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229comm::RetCode LockMgr::ReadRestartCheckpoint(const GroupVector::size_type paxos_group_id,
230 uint64_t &restart_checkpoint) {
231 comm::LockMgrBP::GetThreadInstance()->
232 OnReadCheckpoint(impl_->lock->GetTopicID(), paxos_group_id);
233
234 string vstr;
235 comm::RetCode ret{leveldb(paxos_group_id).Get(KEY_IGNORE_RESTART_CHECKPOINT, vstr)};
236
237 if (comm::RetCode::RET_ERR_KEY_NOT_EXIST == ret) {
238 restart_checkpoint = phxpaxos::NoCheckpoint;
239 QLErr("topic_id %d paxos_group_id %d not exist",
240 impl_->lock->GetTopicID(), paxos_group_id);
241 } else if (comm::RetCode::RET_OK == ret) {
242 restart_checkpoint = strtoul(vstr.c_str(), nullptr, 10);
243 QLInfo("topic_id %d paxos_group_id %d restart_cp %llu ok",
244 impl_->lock->GetTopicID(), paxos_group_id, restart_checkpoint);
245 } else {
246 restart_checkpoint = phxpaxos::NoCheckpoint;
247 QLErr("topic_id %d paxos_group_id %d err %d",
248 impl_->lock->GetTopicID(), paxos_group_id, ret);
249 }
250
251 return ret;
252}
253
254comm::RetCode LockMgr::WriteRestartCheckpoint(const GroupVector::size_type paxos_group_id,
255 const uint64_t restart_checkpoint) {

Callers

nothing calls this directly

Calls 3

OnReadCheckpointMethod · 0.80
GetTopicIDMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected