mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-02-09 09:17:28 +08:00
ui add ec shard statuses
This commit is contained in:
@@ -146,6 +146,7 @@ func (dn *DataNode) ToMap() interface{} {
|
||||
ret := make(map[string]interface{})
|
||||
ret["Url"] = dn.Url()
|
||||
ret["Volumes"] = dn.GetVolumeCount()
|
||||
ret["EcShards"] = dn.GetEcShardsCount()
|
||||
ret["Max"] = dn.GetMaxVolumeCount()
|
||||
ret["Free"] = dn.FreeSpace()
|
||||
ret["PublicUrl"] = dn.PublicUrl
|
||||
|
||||
@@ -14,6 +14,17 @@ func (dn *DataNode) GetEcShards() (ret []*erasure_coding.EcVolumeInfo) {
|
||||
return ret
|
||||
}
|
||||
|
||||
func (dn *DataNode) GetEcShardsCount() (count int) {
|
||||
dn.RLock()
|
||||
defer dn.RUnlock()
|
||||
|
||||
for _, ecVolumeInfo := range dn.ecShards {
|
||||
count += ecVolumeInfo.ShardBits.ShardIdCount()
|
||||
}
|
||||
|
||||
return count
|
||||
}
|
||||
|
||||
func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo) (newShards, deletedShards []*erasure_coding.EcVolumeInfo) {
|
||||
// prepare the new ec shard map
|
||||
actualEcShardMap := make(map[needle.VolumeId]*erasure_coding.EcVolumeInfo)
|
||||
|
||||
Reference in New Issue
Block a user