| 75 | |
| 76 | |
| 77 | void KeepMasterThread::DoRun() { |
| 78 | comm::RetCode ret; |
| 79 | |
| 80 | const int topic_id = impl_->store->GetTopicID(); |
| 81 | |
| 82 | InitMasterRate(); |
| 83 | |
| 84 | shared_ptr<const config::TopicConfig> topic_config; |
| 85 | if (comm::RetCode::RET_OK != |
| 86 | (ret = config::GlobalConfig::GetThreadInstance()-> |
| 87 | GetTopicConfigByTopicID(topic_id, topic_config))) { |
| 88 | QLErr("GetTopicConfigByTopicID ret %d topic_id %d", ret, topic_id); |
| 89 | exit(-1); |
| 90 | } |
| 91 | |
| 92 | while (true) { |
| 93 | if (impl_->stop) return; |
| 94 | |
| 95 | sleep(topic_config->GetProto().topic().store_adjust_master_rate_time_interval_s()); |
| 96 | |
| 97 | UpdatePaxosArgs(); |
| 98 | |
| 99 | AdjustMasterRate(); |
| 100 | |
| 101 | KeepMaster(); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | void KeepMasterThread::InitMasterRate() { |
| 106 | comm::RetCode ret; |
nothing calls this directly
no test coverage detected