This commit is contained in:
chrislu 2023-06-20 00:12:59 -07:00
parent 14a19170e2
commit a82c44972b
2 changed files with 7 additions and 3 deletions

View file

@ -44,9 +44,7 @@ func newClusterNodeGroups() *ClusterNodeGroups {
func (g *ClusterNodeGroups) getGroupMembers(filerGroup FilerGroupName, createIfNotFound bool) *GroupMembers {
members, found := g.groupMembers[filerGroup]
if !found && createIfNotFound {
members = &GroupMembers{
members: make(map[pb.ServerAddress]*ClusterNode),
}
members = newGroupMembers()
g.groupMembers[filerGroup] = members
}
return members

View file

@ -9,6 +9,12 @@ type GroupMembers struct {
members map[pb.ServerAddress]*ClusterNode
}
func newGroupMembers() *GroupMembers {
return &GroupMembers{
members: make(map[pb.ServerAddress]*ClusterNode),
}
}
func (m *GroupMembers) addMember(dataCenter DataCenter, rack Rack, address pb.ServerAddress, version string) *ClusterNode {
if existingNode, found := m.members[address]; found {
existingNode.counter++