add volume delete grpc API

fix https://github.com/chrislusf/seaweedfs/issues/808
This commit is contained in:
Chris Lu
2018-12-29 00:03:30 -08:00
parent 03c7447ad6
commit 0c932d1738
4 changed files with 168 additions and 69 deletions

View File

@@ -254,3 +254,15 @@ func (s *Store) UnmountVolume(i VolumeId) error {
return fmt.Errorf("Volume %d not found on disk", i)
}
func (s *Store) DeleteVolume(i VolumeId) error {
for _, location := range s.Locations {
if error := location.deleteVolumeById(i); error == nil {
s.DeletedVolumeIdChan <- VolumeId(i)
return nil
}
}
return fmt.Errorf("Volume %d not found on disk", i)
}