add a command to force compaction of a volume, removing deleted files
This commit is contained in:
@@ -126,7 +126,7 @@ func (s *Store) CompactVolume(volumeIdString string) error {
|
||||
return fmt.Errorf("Volume Id %s is not a valid unsigned integer!", volumeIdString)
|
||||
}
|
||||
if v := s.findVolume(vid); v != nil {
|
||||
return v.compact()
|
||||
return v.Compact()
|
||||
}
|
||||
return fmt.Errorf("volume id %s is not found during compact!", vid)
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ func (v *Volume) garbageLevel() float64 {
|
||||
return float64(v.nm.DeletedSize()) / float64(v.ContentSize())
|
||||
}
|
||||
|
||||
func (v *Volume) compact() error {
|
||||
func (v *Volume) Compact() error {
|
||||
v.accessLock.Lock()
|
||||
defer v.accessLock.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user