2019-05-22 05:41:20 +00:00
|
|
|
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 {
|
2019-05-24 20:28:44 +00:00
|
|
|
ecShardMessages = append(ecShardMessages, ecShards.ToVolumeEcShardInformationMessage()...)
|
2019-05-22 05:41:20 +00:00
|
|
|
}
|
|
|
|
location.ecShardsLock.RUnlock()
|
|
|
|
}
|
|
|
|
|
|
|
|
return &master_pb.Heartbeat{
|
|
|
|
EcShards: ecShardMessages,
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|