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

Method GetNQueue

phxqueue/config/topicconfig.cpp:404–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404comm::RetCode TopicConfig::GetNQueue(const int queue_info_id, int &nqueue) const {
405 auto &&it(impl_->queue_info_id2ranges.find(queue_info_id));
406 if (it == impl_->queue_info_id2ranges.end()) return comm::RetCode::RET_ERR_RANGE_QUEUE_INFO;
407 auto &&ranges = it->second;
408
409 nqueue = 0;
410 for (auto &&range : ranges) {
411 nqueue += range.second - range.first + 1;
412 }
413 return comm::RetCode::RET_OK;
414}
415
416comm::RetCode TopicConfig::GetQueueByRank(const int queue_info_id, const uint64_t rank, int &queue) const {
417 auto &&it = impl_->queue_info_id2ranges.find(queue_info_id);

Callers 2

CheckTopicConfigMethod · 0.80
TestTopicConfigMethod · 0.80

Calls

no outgoing calls

Tested by 2

CheckTopicConfigMethod · 0.64
TestTopicConfigMethod · 0.64