add broker connects to filer

This commit is contained in:
Chris Lu
2020-05-05 02:05:28 -07:00
parent 47234760f4
commit 1e3e4b3072
17 changed files with 761 additions and 327 deletions

View File

@@ -8,9 +8,10 @@ import (
"sync"
"time"
"github.com/chrislusf/seaweedfs/weed/util/grace"
"google.golang.org/grpc"
"github.com/chrislusf/seaweedfs/weed/util/grace"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
@@ -62,6 +63,9 @@ type FilerServer struct {
// notifying clients
listenersLock sync.Mutex
listenersCond *sync.Cond
brokers map[string]bool
brokersLock sync.Mutex
}
func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) (fs *FilerServer, err error) {
@@ -69,6 +73,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
fs = &FilerServer{
option: option,
grpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.filer"),
brokers: make(map[string]bool),
}
fs.listenersCond = sync.NewCond(&fs.listenersLock)