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

Method AdjustMasterRate

phxqueue/lock/keepmasterthread.cpp:125–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125comm::RetCode KeepMasterThread::AdjustMasterRate() {
126 const int topic_id{impl_->lock->GetTopicID()};
127
128 shared_ptr<const config::TopicConfig> topic_config;
129 comm::RetCode ret{config::GlobalConfig::GetThreadInstance()->GetTopicConfigByTopicID(topic_id, topic_config)};
130 if (comm::RetCode::RET_OK != ret) {
131 QLErr("GetTopicConfigByTopicID ret %d topic %d", ret, topic_id);
132
133 return ret;
134 }
135
136 impl_->master_rate = topic_config->GetProto().topic().lock_adjust_max_master_rate();
137
138 // TODO:
139 //MMPHXLockConfig *conf{mgr_->mutable_conf()};
140
141 //Comm::ZKMgrClient *ptZKMgrClient{Comm::ZKMgrClient::GetDefault()};
142 //if (ptZKMgrClient && ptZKMgrClient->IsSvrBlocked(conf->GetEpollConfig()->GetSvrIP(),
143 // conf->GetEpollConfig()->GetSvrPort())) {
144 // OssAttr4SvrClientMasterHostShieldGlobal(conf->GetEpollConfig()->GetOssAttrID(), 1);
145 // QLInfo("svr %s:%d blocked", conf->GetEpollConfig()->GetSvrIP(), conf->GetEpollConfig()->GetSvrPort());
146 // impl_->master_rate = 0;
147 //} else {
148 // impl_->master_rate = 100;
149 //}
150
151 //QLInfo("masterrate %d", impl_->master_rate);
152
153 return comm::RetCode::RET_OK;
154}
155
156comm::RetCode KeepMasterThread::KeepMaster() {
157 const int topic_id{impl_->lock->GetTopicID()};

Callers

nothing calls this directly

Calls 2

GetTopicIDMethod · 0.45

Tested by

no test coverage detected