| 65 | } |
| 66 | |
| 67 | int 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 | |
| 97 | int EventUUIDHandler::InitNewestInfo() { |
| 98 | return GetLastestUUIDPos(&newest_info_); |
nothing calls this directly
no test coverage detected