This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new a0984f69 Support more meta for ServerNode (#2603)
a0984f69 is described below
commit a0984f696e8effb468c80a770e97e35c4df040f7
Author: Bright Chen <[email protected]>
AuthorDate: Mon Jun 3 16:48:56 2024 +0800
Support more meta for ServerNode (#2603)
---
src/brpc/server_node.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/brpc/server_node.h b/src/brpc/server_node.h
index 81c4b1cd..865a6b1b 100644
--- a/src/brpc/server_node.h
+++ b/src/brpc/server_node.h
@@ -19,13 +19,16 @@
#define BRPC_SERVER_NODE_H
#include <string>
+#include <unordered_map>
#include "butil/endpoint.h"
namespace brpc {
// Representing a server inside a NamingService.
struct ServerNode {
- ServerNode() {}
+ typedef std::unordered_map<std::string, std::string> MetaMap;
+
+ ServerNode() = default;
explicit ServerNode(const butil::EndPoint& pt) : addr(pt) {}
@@ -39,6 +42,7 @@ struct ServerNode {
butil::EndPoint addr;
std::string tag;
+ MetaMap meta_map;
};
inline bool operator<(const ServerNode& n1, const ServerNode& n2)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]