aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/filer.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-12 02:00:54 -0700
committerchrislu <chris.lu@gmail.com>2022-07-28 23:24:38 -0700
commit74f60f246fadee2244b78c0c68259a759be55490 (patch)
tree4b27b3ece34565cf00a0ccf62922016f8bbd4f4d /weed/filer/filer.go
parent9f479aab98e6d8b02026d935af1f614ee8b0b403 (diff)
downloadseaweedfs-74f60f246fadee2244b78c0c68259a759be55490.tar.xz
seaweedfs-74f60f246fadee2244b78c0c68259a759be55490.zip
dynamically connect to a filer
Diffstat (limited to 'weed/filer/filer.go')
-rw-r--r--weed/filer/filer.go23
1 files changed, 1 insertions, 22 deletions
diff --git a/weed/filer/filer.go b/weed/filer/filer.go
index b0df3f618..fcb22fec6 100644
--- a/weed/filer/filer.go
+++ b/weed/filer/filer.go
@@ -105,28 +105,7 @@ func (f *Filer) AggregateFromPeers(self pb.ServerAddress, existingNodes []*maste
}
func (f *Filer) ListExistingPeerUpdates() (existingNodes []*master_pb.ClusterNodeUpdate) {
-
- if grpcErr := pb.WithMasterClient(false, f.MasterClient.GetMaster(), f.GrpcDialOption, func(client master_pb.SeaweedClient) error {
- resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{
- ClientType: cluster.FilerType,
- FilerGroup: f.MasterClient.FilerGroup,
- })
-
- glog.V(0).Infof("the cluster has %d filers\n", len(resp.ClusterNodes))
- for _, node := range resp.ClusterNodes {
- existingNodes = append(existingNodes, &master_pb.ClusterNodeUpdate{
- NodeType: cluster.FilerType,
- Address: node.Address,
- IsLeader: node.IsLeader,
- IsAdd: true,
- CreatedAtNs: node.CreatedAtNs,
- })
- }
- return err
- }); grpcErr != nil {
- glog.V(0).Infof("connect to %s: %v", f.MasterClient.GetMaster(), grpcErr)
- }
- return
+ return cluster.ListExistingPeerUpdates(f.GetMaster(), f.GrpcDialOption, f.MasterClient.FilerGroup, cluster.FilerType)
}
func (f *Filer) SetStore(store FilerStore) (isFresh bool) {