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

Method Process

phxqueue/test/check_config.cpp:32–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32void CheckConfig::Process() {
33 auto global_config = config::GlobalConfig::GetThreadInstance();
34
35 CheckGlobalConfig(global_config);
36
37 std::set<int> topic_ids;
38 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(global_config->GetAllTopicID(topic_ids)));
39
40 for (auto &&topic_id : topic_ids) {
41 QLInfo("topic_id %d checking...", topic_id);
42
43 shared_ptr<const config::TopicConfig> topic_config;
44 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(global_config->GetTopicConfigByTopicID(topic_id, topic_config)));
45 CheckTopicConfig(topic_id, topic_config.get());
46
47 shared_ptr<const config::ConsumerConfig> consumer_config;
48 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(global_config->GetConsumerConfig(topic_id, consumer_config)));
49 CheckConsumerConfig(topic_id, consumer_config.get());
50
51 shared_ptr<const config::StoreConfig> store_config;
52 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(global_config->GetStoreConfig(topic_id, store_config)));
53 CheckStoreConfig(topic_id, store_config.get());
54
55 shared_ptr<const config::SchedulerConfig> scheduler_config;
56 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(global_config->GetSchedulerConfig(topic_id, scheduler_config)));
57 CheckSchedulerConfig(topic_id, scheduler_config.get());
58
59 shared_ptr<const config::LockConfig> lock_config;
60 PHX_ASSERT(phxqueue::comm::as_integer(comm::RetCode::RET_OK), ==, phxqueue::comm::as_integer(global_config->GetLockConfig(topic_id, lock_config)));
61 CheckLockConfig(topic_id, lock_config.get());
62
63 QLInfo("topic_id %d done", topic_id);
64 }
65}
66
67void CheckConfig::CheckGlobalConfig(config::GlobalConfig *global_config) {
68}

Callers

nothing calls this directly

Calls 7

as_integerFunction · 0.85
GetAllTopicIDMethod · 0.80
GetConsumerConfigMethod · 0.80
GetStoreConfigMethod · 0.80
GetSchedulerConfigMethod · 0.80
GetLockConfigMethod · 0.80

Tested by

no test coverage detected