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

Method DoRun

phxqueue/store/keepmasterthread.cpp:77–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76
77void 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
105void KeepMasterThread::InitMasterRate() {
106 comm::RetCode ret;

Callers

nothing calls this directly

Calls 2

GetTopicIDMethod · 0.45

Tested by

no test coverage detected