mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-17 19:48:35 +02:00
find location with matching disk type
This commit is contained in:
1 parent
94525aa0fd
commit
933f2f4cfd
1 file changed
+3
@@ -103,6 +103,9 @@ func (s *Store) findVolume(vid needle.VolumeId) *Volume {
|
|||||||
func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {
|
func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {
|
||||||
max := 0
|
max := 0
|
||||||
for _, location := range s.Locations {
|
for _, location := range s.Locations {
|
||||||
|
if diskType != location.DiskType {
|
||||||
|
continue
|
||||||
|
}
|
||||||
currentFreeCount := location.MaxVolumeCount - location.VolumesLen()
|
currentFreeCount := location.MaxVolumeCount - location.VolumesLen()
|
||||||
currentFreeCount *= erasure_coding.DataShardsCount
|
currentFreeCount *= erasure_coding.DataShardsCount
|
||||||
currentFreeCount -= location.EcVolumesLen()
|
currentFreeCount -= location.EcVolumesLen()
|
||||||
|
|||||||
Reference in new issue
Block a user