aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/data_node_ec.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-06-04 21:52:37 -0700
committerChris Lu <chris.lu@gmail.com>2019-06-04 21:52:37 -0700
commit2215e81be70e4687b8ef775911e30943cc743a13 (patch)
tree2776d712f811d3f5168eb0f2113b79b08f326879 /weed/topology/data_node_ec.go
parent0e5286258672efeeb8e3f62eb15be3542627d5da (diff)
downloadseaweedfs-2215e81be70e4687b8ef775911e30943cc743a13.tar.xz
seaweedfs-2215e81be70e4687b8ef775911e30943cc743a13.zip
ui add ec shard statuses
Diffstat (limited to 'weed/topology/data_node_ec.go')
-rw-r--r--weed/topology/data_node_ec.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/weed/topology/data_node_ec.go b/weed/topology/data_node_ec.go
index 2ea7fc6ad..a0e3a699f 100644
--- a/weed/topology/data_node_ec.go
+++ b/weed/topology/data_node_ec.go
@@ -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)