mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增IsNodeRetire函数,用于判断NodeId是否为Retire状态
This commit is contained in:
@@ -350,6 +350,15 @@ func (cls *Cluster) IsNodeConnected(nodeId int) bool {
|
||||
return pClient != nil && pClient.IsConnected()
|
||||
}
|
||||
|
||||
func (cls *Cluster) IsNodeRetire(nodeId int) bool {
|
||||
cls.locker.RLock()
|
||||
defer cls.locker.RUnlock()
|
||||
|
||||
_,retire :=cls.getRpcClient(nodeId)
|
||||
return retire
|
||||
}
|
||||
|
||||
|
||||
func (cls *Cluster) triggerRpcEvent(bConnect bool, clientId uint32, nodeId int) {
|
||||
cls.locker.Lock()
|
||||
nodeInfo, ok := cls.mapRpc[nodeId]
|
||||
|
||||
Reference in New Issue
Block a user