MCPcopy Create free account
hub / github.com/Tencent/phxsql / InitUUIDHandler

Method InitUUIDHandler

phxbinlogsvr/core/storage/event_uuid_handler.cpp:67–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67int EventUUIDHandler::InitUUIDHandler() {
68 EventDataInfoList list;
69 int ret = FILE_FAIL;
70 event_index_status status = event_index_->GetGTID(GetKeyForUUID(), &list);
71 if (status == event_index_status::DATA_NOT_FOUND) {
72 ret = OK;
73 } else if (status == event_index_status::OK) {
74 ret = ParseFromEventInfoList(list);
75 } else {
76 ret = FILE_FAIL;
77 }
78
79 if (ret == OK) {
80 ret = InitNewestInfo();
81 if (ret) {
82 ColorLogWarning("%s init newest info fail ret %d", __func__, ret);
83 return ret;
84 }
85
86 ret = LoadUUIDInfo();
87 for (auto &it : map_uuid_) {
88 LogVerbose("%s uuid %s-%s", __func__, it.first.c_str(), it.second.gtid().c_str());
89 }
90 }
91 ColorLogInfo("%s init done ret %d newest gtid %s last instance id %llu", __func__, ret, newest_info_.gtid().c_str(),
92 newest_info_.instance_id());
93
94 return ret;
95}
96
97int EventUUIDHandler::InitNewestInfo() {
98 return GetLastestUUIDPos(&newest_info_);

Callers

nothing calls this directly

Calls 4

ColorLogWarningFunction · 0.85
LogVerboseFunction · 0.85
ColorLogInfoFunction · 0.85
GetGTIDMethod · 0.80

Tested by

no test coverage detected