| 224 | } |
| 225 | |
| 226 | void 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 | |
| 264 | void CheckConfig::CheckSchedulerConfig(const int topic_id, const config::SchedulerConfig *scheduler_config) { |
nothing calls this directly
no test coverage detected