| 620 | } |
| 621 | |
| 622 | void KeepSyncThread::GetAllLocalQueue(vector<consumer::Queue_t> &queues) { |
| 623 | queues.clear(); |
| 624 | |
| 625 | comm::RetCode ret; |
| 626 | |
| 627 | const int topic_id = impl_->store->GetTopicID(); |
| 628 | |
| 629 | shared_ptr<const config::TopicConfig> topic_config; |
| 630 | if (comm::RetCode::RET_OK != |
| 631 | (ret = config::GlobalConfig::GetThreadInstance()-> |
| 632 | GetTopicConfigByTopicID(topic_id, topic_config))) { |
| 633 | QLErr("GetTopicConfigByTopicID ret %d", as_integer(ret)); |
| 634 | return; |
| 635 | } |
| 636 | |
| 637 | auto opt = impl_->store->GetStoreOption(); |
| 638 | comm::proto::Addr addr; |
| 639 | addr.set_ip(opt->ip); |
| 640 | addr.set_port(opt->port); |
| 641 | addr.set_paxos_port(opt->paxos_port); |
| 642 | |
| 643 | shared_ptr<const config::StoreConfig> store_config; |
| 644 | if (comm::RetCode::RET_OK != |
| 645 | (ret = config::GlobalConfig::GetThreadInstance()-> |
| 646 | GetStoreConfig(topic_id, store_config))) { |
| 647 | QLErr("GetStoreConfig ret %d topic_id %d", as_integer(ret), topic_id); |
| 648 | return; |
| 649 | } |
| 650 | |
| 651 | int store_id; |
| 652 | if (comm::RetCode::RET_OK != (ret = store_config->GetStoreIDByAddr(addr, store_id))) { |
| 653 | QLErr("GetStoreIDByAddr ret %d", as_integer(ret)); |
| 654 | return; |
| 655 | } |
| 656 | |
| 657 | set<int> pub_ids; |
| 658 | if (comm::RetCode::RET_OK != |
| 659 | (ret = config::utils::GetPubIDsByStoreID(topic_id, store_id, pub_ids))) { |
| 660 | QLErr("GetPubIDsByStoreID ret %d topic_id %d store_id %d", |
| 661 | as_integer(ret), topic_id, store_id); |
| 662 | return; |
| 663 | } |
| 664 | |
| 665 | for (int queue_id{0}; queue_id < opt->nqueue; ++queue_id) { |
| 666 | for (int sub_id{1}; sub_id <= opt->nsub; ++sub_id) { |
| 667 | bool is_valid = false; |
| 668 | for (auto &&pub_id : pub_ids) { |
| 669 | if (topic_config->IsValidQueue(queue_id, pub_id, sub_id)) { |
| 670 | is_valid = true; |
| 671 | break; |
| 672 | } |
| 673 | } |
| 674 | if (!is_valid) continue; |
| 675 | |
| 676 | { |
| 677 | consumer::Queue_t queue; |
| 678 | queue.sub_id = sub_id; |
| 679 | queue.store_id = store_id; |
nothing calls this directly
no test coverage detected