change topology mapping definition, improve spelling
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user