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

Method GetCheckpointState

phxqueue/lock/locksm.cpp:254–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254int LockSM::GetCheckpointState(const int paxos_group_id, string &dir_path,
255 vector<string> &file_list) {
256 comm::LockSMBP::GetThreadInstance()->
257 OnGetCheckpointState(impl_->lock->GetTopicID(), paxos_group_id);
258 QLInfo("topic_id %d paxos_group_id %d dir \"%s\"",
259 impl_->lock->GetTopicID(), paxos_group_id, dir_path.c_str());
260
261 // return mirror
262 dir_path = impl_->mirror_dir_path + to_string(paxos_group_id);
263 file_list.clear();
264
265 int ret{comm::utils::RecursiveListDir(dir_path, &file_list, nullptr, true)};
266 if (0 != ret) {
267 QLErr("topic_id %d paxos_group_id %d RecursiveListDir err %d",
268 impl_->lock->GetTopicID(), paxos_group_id, ret);
269
270 return -1;
271 }
272
273 for (auto &&file_path : file_list) {
274 QLInfo("topic_id %d paxos_group_id %d file \"%s\"",
275 impl_->lock->GetTopicID(), paxos_group_id, file_path.c_str());
276 }
277
278 return 0;
279}
280
281int LockSM::LoadCheckpointState(const int paxos_group_id,
282 const string &checkpoint_tmp_file_dir_path,

Callers

nothing calls this directly

Calls 3

RecursiveListDirFunction · 0.85
OnGetCheckpointStateMethod · 0.80
GetTopicIDMethod · 0.45

Tested by

no test coverage detected