Browse Source

find location with matching disk type

pull/1794/head
Chris Lu 4 years ago
parent
commit
933f2f4cfd
  1. 3
      weed/storage/store.go

3
weed/storage/store.go

@ -103,6 +103,9 @@ func (s *Store) findVolume(vid needle.VolumeId) *Volume {
func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {
max := 0
for _, location := range s.Locations {
if diskType != location.DiskType {
continue
}
currentFreeCount := location.MaxVolumeCount - location.VolumesLen()
currentFreeCount *= erasure_coding.DataShardsCount
currentFreeCount -= location.EcVolumesLen()

Loading…
Cancel
Save