MCPcopy Create free account
hub / github.com/apache/brpc / ServerNode

Class ServerNode

src/brpc/server_node.h:28–46  ·  view source on GitHub ↗

Representing a server inside a NamingService.

Source from the content-addressed store, hash-verified

26
27// Representing a server inside a NamingService.
28struct ServerNode {
29 typedef std::unordered_map<std::string, std::string> MetaMap;
30
31 ServerNode() = default;
32
33 explicit ServerNode(const butil::EndPoint& pt) : addr(pt) {}
34
35 ServerNode(butil::ip_t ip, int port, const std::string& tag2)
36 : addr(ip, port), tag(tag2) {}
37
38 ServerNode(const butil::EndPoint& pt, const std::string& tag2)
39 : addr(pt), tag(tag2) {}
40
41 ServerNode(butil::ip_t ip, int port) : addr(ip, port) {}
42
43 butil::EndPoint addr;
44 std::string tag;
45 MetaMap meta_map;
46};
47
48inline bool operator<(const ServerNode& n1, const ServerNode& n2)
49{ return n1.addr != n2.addr ? (n1.addr < n2.addr) : (n1.tag < n2.tag); }

Callers 3

TESTFunction · 0.85
GetServersMethod · 0.85
GetServersMethod · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68