diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-07-27 23:09:55 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-07-27 23:09:55 -0700 |
| commit | a12c7b86b0ca7ebd35f8763ebc89c675a49f8c59 (patch) | |
| tree | 9dc178cc45dbc03ffce8b15a7a39fbe37b3b1e95 /weed/server/master_server.go | |
| parent | f82ac793b4db7dfcca3d69a5a9c7d0bb3e20d9ac (diff) | |
| download | seaweedfs-a12c7b86b0ca7ebd35f8763ebc89c675a49f8c59.tar.xz seaweedfs-a12c7b86b0ca7ebd35f8763ebc89c675a49f8c59.zip | |
broadcast messages of new and deleted volumes
Diffstat (limited to 'weed/server/master_server.go')
| -rw-r--r-- | weed/server/master_server.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/server/master_server.go b/weed/server/master_server.go index efa0ae104..5b6bc8509 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -14,6 +14,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/topology" "github.com/chrislusf/seaweedfs/weed/util" "github.com/gorilla/mux" + "github.com/chrislusf/seaweedfs/weed/pb/master_pb" ) type MasterServer struct { @@ -31,6 +32,10 @@ type MasterServer struct { vgLock sync.Mutex bounedLeaderChan chan int + + // notifying clients + clientChansLock sync.RWMutex + clientChans map[string]chan *master_pb.VolumeLocation } func NewMasterServer(r *mux.Router, port int, metaFolder string, @@ -54,6 +59,7 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string, pulseSeconds: pulseSeconds, defaultReplicaPlacement: defaultReplicaPlacement, garbageThreshold: garbageThreshold, + clientChans: make(map[string]chan *master_pb.VolumeLocation), } ms.bounedLeaderChan = make(chan int, 16) seq := sequence.NewMemorySequencer() |
