mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-09 07:04:46 +08:00
move to the empty nodes first
This commit is contained in:
@@ -213,6 +213,16 @@ func capacityByMaxVolumeCount(diskType types.DiskType) CapacityFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func capacityByFreeVolumeCount(diskType types.DiskType) CapacityFunc {
|
||||
return func(info *master_pb.DataNodeInfo) int {
|
||||
diskInfo, found := info.DiskInfos[string(diskType)]
|
||||
if !found {
|
||||
return 0
|
||||
}
|
||||
return int(diskInfo.MaxVolumeCount - diskInfo.VolumeCount)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *Node) localVolumeRatio(capacityFunc CapacityFunc) float64 {
|
||||
return divide(len(n.selectedVolumes), capacityFunc(n.info))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user