GetNumOfZones returns number of distinct zones.
()
| 142 | |
| 143 | // GetNumOfZones returns number of distinct zones. |
| 144 | func (r ReplicationSet) GetNumOfZones() int { |
| 145 | set := make(map[string]struct{}) |
| 146 | for _, instance := range r.Instances { |
| 147 | set[instance.GetZone()] = struct{}{} |
| 148 | } |
| 149 | return len(set) |
| 150 | } |
| 151 | |
| 152 | // HasReplicationSetChanged returns false if two replications sets are the same (with possibly different timestamps), |
| 153 | // true if they differ in any way (number of instances, instance states, tokens, zones, ...). |
no test coverage detected