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

Method LoadUUIDInfo

phxbinlogsvr/core/storage/event_uuid_handler.cpp:101–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int EventUUIDHandler::LoadUUIDInfo() {
102 int ret = FILE_FAIL;
103 if (newest_info_.file_name().empty()) {
104 ColorLogInfo("%s no data, open old file", __func__);
105 ret = event_file_manager_->OpenOldestFile();
106 } else {
107 ColorLogInfo("%s open file %s, set offset %d", __func__, newest_info_.file_name().c_str(),
108 newest_info_.offset());
109 ret = event_file_manager_->SetReadPos(newest_info_);
110 }
111 ColorLogInfo("%s newest info gtid %s instance_id %llu ret %d", __func__, newest_info_.gtid().c_str(),
112 newest_info_.instance_id(), ret);
113 while (true) {
114 EventDataInfo data_info;
115 EventData event_data;
116 int ret = event_file_manager_->ReadData(&event_data, &data_info);
117 if (ret == DATA_EMPTY) {
118 return OK;
119 } else if (ret == OK) {
120 ret = UpdateEventUUIDInfoByGTID(event_data.gtid(), data_info);
121 }
122 if (ret) {
123 return ret;
124 }
125 }
126 return FILE_FAIL;
127}
128
129int EventUUIDHandler::ParseFromEventInfoList(const EventDataInfoList &info) {
130 map_uuid_.clear();

Callers

nothing calls this directly

Calls 4

ColorLogInfoFunction · 0.85
OpenOldestFileMethod · 0.80
SetReadPosMethod · 0.80
ReadDataMethod · 0.45

Tested by

no test coverage detected