leveldb3_store_bucket.go 461 B

1234567891011121314151617181920212223
  1. package leveldb
  2. import (
  3. "github.com/seaweedfs/seaweedfs/weed/filer"
  4. "os"
  5. )
  6. var _ filer.BucketAware = (*LevelDB3Store)(nil)
  7. func (store *LevelDB3Store) OnBucketCreation(bucket string) {
  8. store.createDB(bucket)
  9. }
  10. func (store *LevelDB3Store) OnBucketDeletion(bucket string) {
  11. store.closeDB(bucket)
  12. if bucket != "" { // just to make sure
  13. os.RemoveAll(store.dir + "/" + bucket)
  14. }
  15. }
  16. func (store *LevelDB3Store) CanDropWholeBucket() bool {
  17. return true
  18. }