mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
22 lines
538 B
Go
22 lines
538 B
Go
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.ToVolumeEcShardInformationMessage()...)
|
|
}
|
|
location.ecShardsLock.RUnlock()
|
|
}
|
|
|
|
return &master_pb.Heartbeat{
|
|
EcShards: ecShardMessages,
|
|
}
|
|
|
|
}
|