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

Method NextConsumerWeight

phxqueue/scheduler/schedulermgr.cpp:878–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876}
877
878int SchedulerMgr::NextConsumerWeight(const shared_ptr<const config::TopicConfig> &topic_config,
879 const int dynamic_load, const float mean_load,
880 const int init_weight) {
881 if (0 >= dynamic_load)
882 return 0;
883
884 int new_weight{static_cast<int>(init_weight * mean_load /
885 static_cast<float>(dynamic_load))};
886 if (init_weight * topic_config->GetProto().topic().scheduler_max_init_weight_percent() / 100 < new_weight) {
887 new_weight = init_weight * topic_config->GetProto().topic().scheduler_max_init_weight_percent() / 100;
888 }
889
890 return new_weight;
891}
892
893void SchedulerMgr::IsForceMaster(bool &force, bool &master) {
894 force = false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected