mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
rename server sets to server pools
This commit is contained in:
@@ -112,19 +112,19 @@ In above example there are two server sets
|
||||
MinIO places new objects in server sets based on proportionate free space, per zone. Following pseudo code demonstrates this behavior.
|
||||
```go
|
||||
func getAvailableZoneIdx(ctx context.Context) int {
|
||||
serverSets := z.getServerSetsAvailableSpace(ctx)
|
||||
total := serverSets.TotalAvailable()
|
||||
serverPools := z.getServerPoolsAvailableSpace(ctx)
|
||||
total := serverPools.TotalAvailable()
|
||||
// choose when we reach this many
|
||||
choose := rand.Uint64() % total
|
||||
atTotal := uint64(0)
|
||||
for _, zone := range serverSets {
|
||||
for _, zone := range serverPools {
|
||||
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 serverSets (total: %v, atTotal: %v, choose: %v)", total, atTotal, choose))
|
||||
panic(fmt.Errorf("reached end of serverPools (total: %v, atTotal: %v, choose: %v)", total, atTotal, choose))
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -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 {
|
||||
serverSets := z.getServerSetsAvailableSpace(ctx)
|
||||
total := serverSets.TotalAvailable()
|
||||
serverPools := z.getServerPoolsAvailableSpace(ctx)
|
||||
total := serverPools.TotalAvailable()
|
||||
// choose when we reach this many
|
||||
choose := rand.Uint64() % total
|
||||
atTotal := uint64(0)
|
||||
for _, zone := range serverSets {
|
||||
for _, zone := range serverPools {
|
||||
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 serverSets (total: %v, atTotal: %v, choose: %v)", total, atTotal, choose))
|
||||
panic(fmt.Errorf("reached end of serverPools (total: %v, atTotal: %v, choose: %v)", total, atTotal, choose))
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user