can now delete a collection! Is this a dangerous feature? Only enabling

deleting "benchmark" collections for now.
This commit is contained in:
Chris Lu
2014-03-10 11:43:54 -07:00
parent a121453188
commit cd10c277b2
13 changed files with 130 additions and 8 deletions

View File

@@ -111,6 +111,20 @@ func (s *Store) AddVolume(volumeListString string, collection string, replicaPla
}
return e
}
func (s *Store) DeleteCollection(collection string) (e error) {
for _, location := range s.locations {
for k, v := range location.volumes {
if v.Collection == collection {
e = v.Destroy()
if e != nil {
return
}
delete(location.volumes, k)
}
}
}
return
}
func (s *Store) findVolume(vid VolumeId) *Volume {
for _, location := range s.locations {
if v, found := location.volumes[vid]; found {