From 1c233ad986bbbf5de3394c734a1bafebaf67b9e0 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 22 Feb 2021 00:28:42 -0800 Subject: refactoring --- weed/shell/command_volume_configure_replication.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'weed/shell/command_volume_configure_replication.go') diff --git a/weed/shell/command_volume_configure_replication.go b/weed/shell/command_volume_configure_replication.go index ecbe402e8..e3f034873 100644 --- a/weed/shell/command_volume_configure_replication.go +++ b/weed/shell/command_volume_configure_replication.go @@ -56,11 +56,8 @@ func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *Comman } replicaPlacementInt32 := uint32(replicaPlacement.Byte()) - var resp *master_pb.VolumeListResponse - err = commandEnv.MasterClient.WithClient(func(client master_pb.SeaweedClient) error { - resp, err = client.VolumeList(context.Background(), &master_pb.VolumeListRequest{}) - return err - }) + // collect topology information + topologyInfo, _, err := collectTopologyInfo(commandEnv) if err != nil { return err } @@ -69,7 +66,7 @@ func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *Comman // find all data nodes with volumes that needs replication change var allLocations []location - eachDataNode(resp.TopologyInfo, func(dc string, rack RackId, dn *master_pb.DataNodeInfo) { + eachDataNode(topologyInfo, func(dc string, rack RackId, dn *master_pb.DataNodeInfo) { loc := newLocation(dc, string(rack), dn) for _, diskInfo := range dn.DiskInfos { for _, v := range diskInfo.VolumeInfos { -- cgit v1.2.3