ClusterAddrTable和BrokerLiveTable数据表结构

2021-09-26 17:27:16 浏览数 (1)

ClusterAddrTable

说明:Broker集群信息,存储集群中所有Broker名称。

数据结构:HashMap结构,key是ClusterName,value是存储BrokerName的Set结构。

数据结构示例:

代码语言:javascript复制
clusterAddrTable:{
    "c1": ["broker-a","broker-b"]
}

BrokerLiveTable

说明:Broker状态信息。NameServer每次收到心跳包时会替换该信息

数据结构:HashMap结构,key是Broker的地址,value是BrokerLiveInfo结构的该Broker信息对象。BrokerLiveInfo的数据结构如下:

数据结构示例:

代码语言:javascript复制
brokerLiveTable:{
    "192.168.1.1:10000": {
            "lastUpdateTimestamp": 1518270318980,
            "dataVersion":versionObj1,
            "channel":channelObj,
            "haServerAddr":""
    },
    "192.168.1.2:10000": {
            "lastUpdateTimestamp": 1518270318980,
            "dataVersion":versionObj1,
            "channel":channelObj,
            "haServerAddr":"192.168.1.1:10000"
     },
    "192.168.1.3:10000": {
            "lastUpdateTimestamp": 1518270318980,
            "dataVersion":versionObj1,
            "channel":channelObj,
            "haServerAddr":""
     },
    "192.168.1.4:10000": {
            "lastUpdateTimestamp": 1518270318980,
            "dataVersion":versionObj1,
            "channel":channelObj,
            "haServerAddr":"192.168.1.3:10000"
     }
}

0 人点赞