| 70 | |
| 71 | |
| 72 | comm::RetCode SimpleConsumer::GetAddrScale(const comm::proto::GetAddrScaleRequest &req, |
| 73 | comm::proto::GetAddrScaleResponse &resp) { |
| 74 | // return default |
| 75 | comm::RetCode ret; |
| 76 | |
| 77 | shared_ptr<const config::ConsumerConfig> consumer_config; |
| 78 | if (comm::RetCode::RET_OK != (ret = config::GlobalConfig::GetThreadInstance()-> |
| 79 | GetConsumerConfig(GetTopicID(), consumer_config))) { |
| 80 | QLErr("GetConsumerConfig ret %d", as_integer(ret)); |
| 81 | return ret; |
| 82 | } |
| 83 | |
| 84 | for (int i{0}; i < consumer_config->GetProto().consumers_size(); ++i) { |
| 85 | auto &&consumer = consumer_config->GetProto().consumers(i); |
| 86 | auto &&addr_scale = resp.add_addr_scales(); |
| 87 | addr_scale->mutable_addr()->CopyFrom(consumer.addr()); |
| 88 | addr_scale->set_scale(consumer.scale()); |
| 89 | } |
| 90 | |
| 91 | return comm::RetCode::RET_OK; |
| 92 | } |
| 93 | |
| 94 | comm::RetCode SimpleConsumer::GetQueueByAddrScale(const std::vector<consumer::Queue_t> &queues, |
| 95 | const consumer::AddrScales &addr_scales, |
no test coverage detected