mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 16:04:54 +08:00
can now delete a collection! Is this a dangerous feature? Only enabling
deleting "benchmark" collections for now.
This commit is contained in:
@@ -14,6 +14,7 @@ type NeedleMapper interface {
|
||||
Get(key uint64) (element *NeedleValue, ok bool)
|
||||
Delete(key uint64) error
|
||||
Close()
|
||||
Destroy() error
|
||||
ContentSize() uint64
|
||||
DeletedSize() uint64
|
||||
FileCount() int
|
||||
@@ -155,6 +156,10 @@ func (nm *NeedleMap) Delete(key uint64) error {
|
||||
func (nm *NeedleMap) Close() {
|
||||
_ = nm.indexFile.Close()
|
||||
}
|
||||
func (nm *NeedleMap) Destroy() error {
|
||||
nm.Close()
|
||||
return os.Remove(nm.indexFile.Name())
|
||||
}
|
||||
func (nm NeedleMap) ContentSize() uint64 {
|
||||
return nm.FileByteCounter
|
||||
}
|
||||
|
Reference in New Issue
Block a user