rename zones to serverSets to avoid terminology conflict (#10679)

we are bringing in availability zones, we should avoid
zones as per server expansion concept.
This commit is contained in:
Harshavardhana
2020-10-15 14:28:50 -07:00
committed by GitHub
parent db2241066b
commit ad726b49b4
30 changed files with 416 additions and 416 deletions

View File

@@ -113,19 +113,19 @@ minio server http://host{1...32}/export{1...32} http://host{5...6}/export{1...8}
MinIO根据每个区域的可用空间比例将新对象放置在区域中。以下伪代码演示了此行为。
```go
func getAvailableZoneIdx(ctx context.Context) int {
zones := z.getZonesAvailableSpace(ctx)
total := zones.TotalAvailable()
serverSets := z.getServerSetsAvailableSpace(ctx)
total := serverSets.TotalAvailable()
// choose when we reach this many
choose := rand.Uint64() % total
atTotal := uint64(0)
for _, zone := range zones {
for _, zone := range serverSets {
atTotal += zone.Available
if atTotal > choose && zone.Available > 0 {
return zone.Index
}
}
// Should not happen, but print values just in case.
panic(fmt.Errorf("reached end of zones (total: %v, atTotal: %v, choose: %v)", total, atTotal, choose))
panic(fmt.Errorf("reached end of serverSets (total: %v, atTotal: %v, choose: %v)", total, atTotal, choose))
}
```