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/volume_layout.go | |
| parent | 6f882eb354ff61d663a122c430781493cecf2467 (diff) | |
| download | seaweedfs-58f2dd674061bb48f433abbebd604ba7a8fe1aa7.tar.xz seaweedfs-58f2dd674061bb48f433abbebd604ba7a8fe1aa7.zip | |
change topology mapping definition, improve spelling
Diffstat (limited to 'weed/topology/volume_layout.go')
| -rw-r--r-- | weed/topology/volume_layout.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go index dee82762a..03c4c4adf 100644 --- a/weed/topology/volume_layout.go +++ b/weed/topology/volume_layout.go @@ -473,13 +473,19 @@ func (vl *VolumeLayout) SetVolumeCrowded(vid needle.VolumeId) { } } -func (vl *VolumeLayout) ToMap() map[string]interface{} { - m := make(map[string]interface{}) - m["replication"] = vl.rp.String() - m["ttl"] = vl.ttl.String() - m["writables"] = vl.writables +type VolumeLayoutInfo struct { + Replication string `json:"replication"` + TTL string `json:"ttl"` + Writables []needle.VolumeId `json:"writables"` + Collection string `json:"collection"` +} + +func (vl *VolumeLayout) ToInfo() (info VolumeLayoutInfo) { + info.Replication = vl.rp.String() + info.TTL = vl.ttl.String() + info.Writables = vl.writables //m["locations"] = vl.vid2location - return m + return } func (vl *VolumeLayout) Stats() *VolumeLayoutStats { |
