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

Method CheckStoreConfig

phxqueue/test/check_config.cpp:226–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void CheckConfig::CheckStoreConfig(const int topic_id, const config::StoreConfig *store_config) {
227
228 std::vector<std::shared_ptr<const config::proto::Store>> stores;
229 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(store_config->GetAllStore(stores)));
230
231 std::set<int> store_ids;
232 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(store_config->GetAllStoreID(store_ids)));
233 PHX_ASSERT(store_ids.size(), ==, stores.size());
234
235 for (auto &&store : stores) {
236 auto store_id = store->store_id();
237
238 PHX_ASSERT(store_ids.end() != store_ids.find(store_id), ==, true);
239
240 {
241 std::shared_ptr<const config::proto::Store> tmp_store;
242 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(store_config->GetStoreByStoreID(store_id, tmp_store)));
243 PHX_ASSERT(store_id, ==, tmp_store->store_id());
244 }
245
246 for (int i{0}; i < store->addrs_size(); ++i) {
247 auto &&addr = store->addrs(i);
248
249 {
250 int tmp_store_id;
251 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(store_config->GetStoreIDByAddr(addr, tmp_store_id)));
252 PHX_ASSERT(tmp_store_id, ==, store_id);
253 }
254 {
255 std::shared_ptr<const config::proto::Store> tmp_store;
256 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(store_config->GetStoreByAddr(addr, tmp_store)));
257 PHX_ASSERT(tmp_store->store_id(), ==, store_id);
258 }
259 }
260 }
261}
262
263
264void CheckConfig::CheckSchedulerConfig(const int topic_id, const config::SchedulerConfig *scheduler_config) {

Callers

nothing calls this directly

Calls 6

as_integerFunction · 0.85
GetAllStoreMethod · 0.80
GetAllStoreIDMethod · 0.80
GetStoreByStoreIDMethod · 0.80
GetStoreIDByAddrMethod · 0.80
GetStoreByAddrMethod · 0.80

Tested by

no test coverage detected