diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-13 03:11:24 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-13 03:11:24 -0800 |
| commit | d156c74ec097add1954fa2a0a9a55eb02b44bb0e (patch) | |
| tree | 872edef3665d27b852631303f031aa97470f4ad5 /weed/topology/rack.go | |
| parent | e9cd798bd372741753efcba2af594b00fe7b8437 (diff) | |
| download | seaweedfs-d156c74ec097add1954fa2a0a9a55eb02b44bb0e.tar.xz seaweedfs-d156c74ec097add1954fa2a0a9a55eb02b44bb0e.zip | |
volume server set volume type and heartbeat to the master
Diffstat (limited to 'weed/topology/rack.go')
| -rw-r--r-- | weed/topology/rack.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/topology/rack.go b/weed/topology/rack.go index 1921c0c05..35563abe5 100644 --- a/weed/topology/rack.go +++ b/weed/topology/rack.go @@ -28,7 +28,7 @@ func (r *Rack) FindDataNode(ip string, port int) *DataNode { } return nil } -func (r *Rack) GetOrCreateDataNode(ip string, port int, publicUrl string, maxVolumeCount int64) *DataNode { +func (r *Rack) GetOrCreateDataNode(ip string, port int, publicUrl string, maxVolumeCount int64, maxSsdVolumeCount int64) *DataNode { for _, c := range r.Children() { dn := c.(*DataNode) if dn.MatchLocation(ip, port) { @@ -41,6 +41,7 @@ func (r *Rack) GetOrCreateDataNode(ip string, port int, publicUrl string, maxVol dn.Port = port dn.PublicUrl = publicUrl dn.maxVolumeCount = maxVolumeCount + dn.maxSsdVolumeCount = maxSsdVolumeCount dn.LastSeen = time.Now().Unix() r.LinkChildNode(dn) return dn @@ -50,6 +51,7 @@ func (r *Rack) ToMap() interface{} { m := make(map[string]interface{}) m["Id"] = r.Id() m["Max"] = r.GetMaxVolumeCount() + m["MaxSsd"] = r.GetMaxSsdVolumeCount() m["Free"] = r.FreeSpace() var dns []interface{} for _, c := range r.Children() { @@ -65,6 +67,8 @@ func (r *Rack) ToRackInfo() *master_pb.RackInfo { Id: string(r.Id()), VolumeCount: uint64(r.GetVolumeCount()), MaxVolumeCount: uint64(r.GetMaxVolumeCount()), + MaxSsdVolumeCount: uint64(r.GetMaxSsdVolumeCount()), + SsdVolumeCount: uint64(r.GetSsdVolumeCount()), FreeVolumeCount: uint64(r.FreeSpace()), ActiveVolumeCount: uint64(r.GetActiveVolumeCount()), RemoteVolumeCount: uint64(r.GetRemoteVolumeCount()), |
