| 63 | } |
| 64 | |
| 65 | HostWithPortsVec 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 | |
| 87 | void registerAutoStatisticsDaemon(DaemonFactory & factory) |
| 88 | { |
no test coverage detected