mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-24 07:33:35 +08:00
prefix search, bucket implemented
This commit is contained in:
30
weed/filer/arangodb/arangodb_store_bucket.go
Normal file
30
weed/filer/arangodb/arangodb_store_bucket.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package arangodb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||
"time"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
)
|
||||
|
||||
var _ filer.BucketAware = (*ArangodbStore)(nil)
|
||||
|
||||
func (store *ArangodbStore) OnBucketCreation(bucket string) {
|
||||
//nothing needs to be done
|
||||
}
|
||||
func (store *ArangodbStore) OnBucketDeletion(bucket string) {
|
||||
timeout, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
cur, err := store.database.Query(timeout, `
|
||||
for d in files
|
||||
filter d.bucket == @bucket
|
||||
remove d in files`, map[string]interface{}{"bucket": bucket})
|
||||
if err != nil {
|
||||
glog.V(0).Infof("bucket delete %s : %v", bucket, err)
|
||||
}
|
||||
defer cur.Close()
|
||||
}
|
||||
func (store *ArangodbStore) CanDropWholeBucket() bool {
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user