aboutsummaryrefslogtreecommitdiff
path: root/weed/server/filer_server.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-08-23 00:31:33 -0700
committerchrislu <chris.lu@gmail.com>2023-08-23 00:31:33 -0700
commit99f037b958b5952628d281461d3bfb76fa433d8c (patch)
tree7b82cb004ef223e7c3a63a1aa8a3172c6ac060f8 /weed/server/filer_server.go
parenteac92c334a7b7222b5289cb04733ec87abf36075 (diff)
downloadseaweedfs-99f037b958b5952628d281461d3bfb76fa433d8c.tar.xz
seaweedfs-99f037b958b5952628d281461d3bfb76fa433d8c.zip
streaming assign file ids
Diffstat (limited to 'weed/server/filer_server.go')
-rw-r--r--weed/server/filer_server.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go
index 8a6d341bb..8e40b2145 100644
--- a/weed/server/filer_server.go
+++ b/weed/server/filer_server.go
@@ -94,6 +94,9 @@ type FilerServer struct {
// track known metadata listeners
knownListenersLock sync.Mutex
knownListeners map[int32]int32
+
+ // client to assign file id
+ assignProxy *operation.AssignProxy
}
func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) (fs *FilerServer, err error) {
@@ -131,6 +134,8 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
go stats.LoopPushingMetric("filer", string(fs.option.Host), fs.metricsAddress, fs.metricsIntervalSec)
go fs.filer.KeepMasterClientConnected()
+ fs.assignProxy, err = operation.NewAssignProxy(fs.filer.GetMaster, fs.grpcDialOption, 16)
+
if !util.LoadConfiguration("filer", false) {
v.SetDefault("leveldb2.enabled", true)
v.SetDefault("leveldb2.dir", option.DefaultLevelDbDir)
@@ -183,7 +188,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
fs.filer.Dlm.LockRing.SetTakeSnapshotCallback(fs.OnDlmChangeSnapshot)
- return fs, nil
+ return fs, err
}
func (fs *FilerServer) checkWithMaster() {