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

Method GetMode

phxqueue/scheduler/schedulermgr.cpp:589–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589Mode SchedulerMgr::GetMode(const int topic_id, TopicData &topic_data, const uint64_t now) {
590 Mode mode{Mode::Dynamic};
591 std::shared_ptr<const config::TopicConfig> topic_config;
592 comm::RetCode ret{config::GlobalConfig::GetThreadInstance()->
593 GetTopicConfigByTopicID(topic_id, topic_config)};
594 if (comm::RetCode::RET_OK != ret) {
595 QLErr("GetTopicConfigByTopicID err %d", ret);
596
597 return Mode::Static;
598 }
599
600 if (topic_data.init_time +
601 3 * topic_config->GetProto().topic().scheduler_get_scale_interval_s() * 1000 >= now) {
602 // stay a long time for most consumer GetAddrScale()
603 QLInfo("Mode::Dynamic not ready");
604 mode = Mode::Static;
605 }
606
607 return mode;
608}
609
610comm::RetCode SchedulerMgr::GetMeanLoad(const int topic_id, const TopicData &topic_data,
611 float &mean_load) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected