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

Method GetCheckpointInstanceID

phxqueue/store/storesm.cpp:113–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113const uint64_t StoreSM::GetCheckpointInstanceID(const int paxos_group_id) const {
114 QLVerb("StoreSM::GetCheckpointInstanceID begin");
115
116 // TODO: use MAX_
117 uint64_t cp = -1;
118
119 comm::RetCode ret;
120
121 auto stat(impl_->store->GetCheckPointStatMgr()->GetCheckPointStat(paxos_group_id));
122 if (!stat) {
123 QLErr("CheckPointStatMgr::GetCheckPointStat fail paxos_group_id %d", paxos_group_id);
124 return -1;
125 }
126 if (comm::RetCode::RET_OK != (ret = stat->GetCheckPoint(cp))) {
127 QLErr("GetCheckPoint fail ret %d", as_integer(ret));
128 return -1;
129 }
130 QLVerb("paxos_group_id %d cp %" PRIu64, paxos_group_id, cp);
131
132
133 comm::StoreSMBP::GetThreadInstance()->OnGetCheckpointInstanceID(paxos_group_id, cp);
134
135 return cp;
136}
137
138
139int StoreSM::GetCheckpointState(const int paxos_group_id, string &dir_path,

Callers

nothing calls this directly

Calls 5

as_integerFunction · 0.85
GetCheckPointStatMethod · 0.80
GetCheckPointStatMgrMethod · 0.80
GetCheckPointMethod · 0.80

Tested by

no test coverage detected