MCPcopy Create free account
hub / github.com/apache/kvrocks / GetSlaveHostAndPort

Method GetSlaveHostAndPort

src/server/server.cc:2222–2234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2220}
2221
2222std::list<std::pair<std::string, uint32_t>> Server::GetSlaveHostAndPort() {
2223 std::list<std::pair<std::string, uint32_t>> result;
2224 {
2225 std::shared_lock<std::shared_mutex> guard(slave_threads_mu_);
2226 for (const auto &slave : slave_threads_) {
2227 if (slave->IsStopped()) continue;
2228 std::pair<std::string, int> host_port_pair = {slave->GetConn()->GetAnnounceIP(),
2229 slave->GetConn()->GetListeningPort()};
2230 result.emplace_back(host_port_pair);
2231 }
2232 }
2233 return result;
2234}
2235
2236// The numeric cursor consists of a 16-bit counter, a 16-bit time stamp, a 29-bit hash,and a 3-bit cursor type. The
2237// hash is used to prevent information leakage. The time_stamp is used to prevent the generation of the same cursor in

Callers 1

Calls 4

GetAnnounceIPMethod · 0.80
GetConnMethod · 0.80
GetListeningPortMethod · 0.80
IsStoppedMethod · 0.45

Tested by

no test coverage detected