mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-21 16:43:23 +08:00
22 lines
531 B
Go
22 lines
531 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.ToVolumeInformationMessage()...)
|
||
|
}
|
||
|
location.ecShardsLock.RUnlock()
|
||
|
}
|
||
|
|
||
|
return &master_pb.Heartbeat{
|
||
|
EcShards: ecShardMessages,
|
||
|
}
|
||
|
|
||
|
}
|