aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2/filer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-06-01 00:39:39 -0700
committerChris Lu <chris.lu@gmail.com>2018-06-01 00:39:39 -0700
commit43e3f5724ca31918cd5a3d282639bd4f34e6bc58 (patch)
tree8aa653c78756a9adc2f98e7e281e0892bad95735 /weed/filer2/filer.go
parenta6f7f9b0b8baedad7b1555c7e01a4ab3cec3784c (diff)
downloadseaweedfs-43e3f5724ca31918cd5a3d282639bd4f34e6bc58.tar.xz
seaweedfs-43e3f5724ca31918cd5a3d282639bd4f34e6bc58.zip
use fixed list of masters in both filer and volume servers
Diffstat (limited to 'weed/filer2/filer.go')
-rw-r--r--weed/filer2/filer.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go
index 0b4113c38..e886b7d74 100644
--- a/weed/filer2/filer.go
+++ b/weed/filer2/filer.go
@@ -13,14 +13,16 @@ import (
)
type Filer struct {
- master string
+ masters []string
store FilerStore
directoryCache *ccache.Cache
+
+ currentMaster string
}
-func NewFiler(master string) *Filer {
+func NewFiler(masters []string) *Filer {
return &Filer{
- master: master,
+ masters: masters,
directoryCache: ccache.New(ccache.Configure().MaxSize(1000).ItemsToPrune(100)),
}
}
@@ -175,14 +177,12 @@ func (f *Filer) cacheSetDirectory(dirpath string, dirEntry *Entry, level int) {
}
func (f *Filer) deleteChunks(entry *Entry) {
- if f.master == "" {
- return
- }
+
if entry == nil {
return
}
for _, chunk := range entry.Chunks {
- if err := operation.DeleteFile(f.master, chunk.FileId, ""); err != nil {
+ if err := operation.DeleteFile(f.GetMaster(), chunk.FileId, ""); err != nil {
glog.V(0).Infof("deleting file %s: %v", chunk.FileId, err)
}
}