volume: load ec shards during heartbeats to master

This commit is contained in:
Chris Lu
2019-05-21 22:41:20 -07:00
parent 54b835e1ae
commit 17ac1290c0
23 changed files with 591 additions and 207 deletions

21
weed/storage/store_ec.go Normal file
View File

@@ -0,0 +1,21 @@
package storage
import (
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
)
func (s *Store) CollectErasureCodingHeartbeat() *master_pb.Heartbeat {
var ecShardMessages []*master_pb.VolumeEcShardInformationMessage
for _, location := range s.Locations {
location.ecShardsLock.RLock()
for _, ecShards := range location.ecShards {
ecShardMessages = append(ecShardMessages, ecShards.ToVolumeInformationMessage()...)
}
location.ecShardsLock.RUnlock()
}
return &master_pb.Heartbeat{
EcShards: ecShardMessages,
}
}