MCPcopy Create free account
hub / github.com/ByConity/ByConity / getServerList

Method getServerList

src/DaemonManager/DaemonJobAutoStatistics.cpp:65–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65HostWithPortsVec DaemonJobAutoStatistics::getServerList(const ContextPtr & ctx)
66{
67 auto topology_master = ctx->getCnchTopologyMaster();
68 if (!topology_master)
69 {
70 throw Exception("Failed to get topology master, skip iteration", ErrorCodes::LOGICAL_ERROR);
71 }
72
73 std::list<CnchServerTopology> server_topologies = topology_master->getCurrentTopology();
74 if (server_topologies.empty())
75 {
76 throw Exception("Server topology is empty, something wrong with topology, return empty result", ErrorCodes::LOGICAL_ERROR);
77 }
78
79 HostWithPortsVec host_ports_vec = server_topologies.back().getServerList();
80 if (host_ports_vec.empty())
81 {
82 throw Exception("Server topology is empty, something wrong with serverList, return empty result", ErrorCodes::LOGICAL_ERROR);
83 }
84 return host_ports_vec;
85}
86
87void registerAutoStatisticsDaemon(DaemonFactory & factory)
88{

Callers 4

getServersInTopologyFunction · 0.45
fetchServerStartTimesFunction · 0.45
getServerClientsFunction · 0.45
createPoolsToCnchServerFunction · 0.45

Calls 4

getCnchTopologyMasterMethod · 0.80
getCurrentTopologyMethod · 0.80
ExceptionClass · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected