aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/data_node_ec.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-05-22 22:44:28 -0700
committerChris Lu <chris.lu@gmail.com>2019-05-22 22:44:28 -0700
commit7180520889c57bffcd060820954fd3288a388196 (patch)
treeba324284619d166fd10f938f179127cc90bc503d /weed/topology/data_node_ec.go
parent17ac1290c0087a8264827e2ab1e9662f3ab4d257 (diff)
downloadseaweedfs-7180520889c57bffcd060820954fd3288a388196.tar.xz
seaweedfs-7180520889c57bffcd060820954fd3288a388196.zip
ec shard info can be queried via VolumeList()
Diffstat (limited to 'weed/topology/data_node_ec.go')
-rw-r--r--weed/topology/data_node_ec.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/topology/data_node_ec.go b/weed/topology/data_node_ec.go
new file mode 100644
index 000000000..d1715f557
--- /dev/null
+++ b/weed/topology/data_node_ec.go
@@ -0,0 +1,14 @@
+package topology
+
+import (
+ "github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
+)
+
+func (dn *DataNode) GetEcShards() (ret []erasure_coding.EcVolumeInfo) {
+ dn.RLock()
+ for _, ecVolumeInfo := range dn.ecShards {
+ ret = append(ret, ecVolumeInfo)
+ }
+ dn.RUnlock()
+ return ret
+}