seaweedfs/weed/filer/leveldb3/leveldb3_store_bucket.go

24 lines
461 B
Go
Raw Normal View History

2022-07-22 09:48:51 +08:00
package leveldb
import (
"github.com/seaweedfs/seaweedfs/weed/filer"
2022-07-22 09:48:51 +08:00
"os"
)
var _ filer.BucketAware = (*LevelDB3Store)(nil)
func (store *LevelDB3Store) OnBucketCreation(bucket string) {
store.createDB(bucket)
}
func (store *LevelDB3Store) OnBucketDeletion(bucket string) {
store.closeDB(bucket)
if bucket != "" { // just to make sure
os.RemoveAll(store.dir + "/" + bucket)
}
}
func (store *LevelDB3Store) CanDropWholeBucket() bool {
return true
}