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

Method GenMasterInfoByLocal

phxbinlogsvr/core/handler/master_manager.cpp:80–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80int MasterManager::GenMasterInfoByLocal(const string &master_ip, MasterInfo *info) {
81 int ret = GetMasterInfo(info);
82 if (ret)
83 return ret;
84
85 info->set_port(option_->GetMySqlConfig()->GetMySQLPort());
86 info->set_svr_id(Utils::GetSvrID(master_ip));
87
88 return OK;
89}
90
91bool MasterManager::IsMaster(const MasterInfo &info) {
92 return info.svr_id() == option_->GetBinLogSvrConfig()->GetEngineSvrID() && !IsTimeOut(info);

Callers 1

SetMasterMethod · 0.80

Calls 2

GetMySQLPortMethod · 0.80
GetMySqlConfigMethod · 0.80

Tested by

no test coverage detected