diff options
| author | ningfd <fangdi.ning@seetatech.com> | 2022-07-22 17:18:33 +0800 |
|---|---|---|
| committer | ningfd <fangdi.ning@seetatech.com> | 2022-07-22 17:18:56 +0800 |
| commit | 58f2dd674061bb48f433abbebd604ba7a8fe1aa7 (patch) | |
| tree | ff08269bbead68cb88f3e98f854cbefa165e4edf /weed/topology/data_node.go | |
| parent | 6f882eb354ff61d663a122c430781493cecf2467 (diff) | |
| download | seaweedfs-58f2dd674061bb48f433abbebd604ba7a8fe1aa7.tar.xz seaweedfs-58f2dd674061bb48f433abbebd604ba7a8fe1aa7.zip | |
change topology mapping definition, improve spelling
Diffstat (limited to 'weed/topology/data_node.go')
| -rw-r--r-- | weed/topology/data_node.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index 6a24c4a49..33bff2d59 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -217,7 +217,7 @@ func (dn *DataNode) ServerAddress() pb.ServerAddress { return pb.NewServerAddress(dn.Ip, dn.Port, dn.GrpcPort) } -type DataNodeMap struct { +type DataNodeInfo struct { Url string `json:"Url"` PublicUrl string `json:"PublicUrl"` Volumes int64 `json:"Volumes"` @@ -226,10 +226,9 @@ type DataNodeMap struct { VolumeIds string `json:"VolumeIds"` } -func (dn *DataNode) ToMap() DataNodeMap { - ret := DataNodeMap{} - ret.Url = dn.Url() - ret.PublicUrl = dn.PublicUrl +func (dn *DataNode) ToInfo() (info DataNodeInfo) { + info.Url = dn.Url() + info.PublicUrl = dn.PublicUrl // aggregated volume info var volumeCount, ecShardCount, maxVolumeCount int64 @@ -245,12 +244,12 @@ func (dn *DataNode) ToMap() DataNodeMap { volumeIds += " " + d.GetVolumeIds() } - ret.Volumes = volumeCount - ret.EcShards = ecShardCount - ret.Max = maxVolumeCount - ret.VolumeIds = volumeIds + info.Volumes = volumeCount + info.EcShards = ecShardCount + info.Max = maxVolumeCount + info.VolumeIds = volumeIds - return ret + return } func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo { |
