Browse Source

ec shard info can be queried via VolumeList()

pull/991/head
Chris Lu 6 years ago
parent
commit
7180520889
  1. 1
      weed/pb/master.proto
  2. 221
      weed/pb/master_pb/master.pb.go
  3. 6
      weed/storage/erasure_coding/ec_volume.go
  4. 46
      weed/storage/erasure_coding/ec_volume_info.go
  5. 18
      weed/topology/data_node.go
  6. 14
      weed/topology/data_node_ec.go

1
weed/pb/master.proto

@ -186,6 +186,7 @@ message DataNodeInfo {
uint64 free_volume_count = 4;
uint64 active_volume_count = 5;
repeated VolumeInformationMessage volume_infos = 6;
repeated VolumeEcShardInformationMessage ec_shard_infos = 7;
}
message RackInfo {
string id = 1;

221
weed/pb/master_pb/master.pb.go

@ -895,12 +895,13 @@ func (*CollectionDeleteResponse) Descriptor() ([]byte, []int) { return fileDescr
// volume related
//
type DataNodeInfo struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"`
MaxVolumeCount uint64 `protobuf:"varint,3,opt,name=max_volume_count,json=maxVolumeCount" json:"max_volume_count,omitempty"`
FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"`
ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"`
VolumeInfos []*VolumeInformationMessage `protobuf:"bytes,6,rep,name=volume_infos,json=volumeInfos" json:"volume_infos,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"`
MaxVolumeCount uint64 `protobuf:"varint,3,opt,name=max_volume_count,json=maxVolumeCount" json:"max_volume_count,omitempty"`
FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"`
ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"`
VolumeInfos []*VolumeInformationMessage `protobuf:"bytes,6,rep,name=volume_infos,json=volumeInfos" json:"volume_infos,omitempty"`
EcShardInfos []*VolumeEcShardInformationMessage `protobuf:"bytes,7,rep,name=ec_shard_infos,json=ecShardInfos" json:"ec_shard_infos,omitempty"`
}
func (m *DataNodeInfo) Reset() { *m = DataNodeInfo{} }
@ -950,6 +951,13 @@ func (m *DataNodeInfo) GetVolumeInfos() []*VolumeInformationMessage {
return nil
}
func (m *DataNodeInfo) GetEcShardInfos() []*VolumeEcShardInformationMessage {
if m != nil {
return m.EcShardInfos
}
return nil
}
type RackInfo struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"`
@ -1554,104 +1562,105 @@ var _Seaweed_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("master.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 1572 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6e, 0xdc, 0x46,
0x12, 0x16, 0xe7, 0x4f, 0x33, 0x35, 0x9a, 0xd1, 0x4c, 0x4b, 0xb6, 0xa9, 0xf1, 0xda, 0x1e, 0xd3,
0x97, 0xb1, 0x77, 0x57, 0xeb, 0xd5, 0x1e, 0xf6, 0xb0, 0x1b, 0x18, 0xb6, 0x2c, 0x27, 0x82, 0xe5,
0x3f, 0x8e, 0xed, 0x00, 0x01, 0x02, 0x86, 0x22, 0x4b, 0x32, 0x21, 0x0e, 0xc9, 0x90, 0x3d, 0xb2,
0xc6, 0x97, 0x1c, 0x92, 0x63, 0x90, 0x1c, 0xf2, 0x12, 0x79, 0x88, 0x20, 0x97, 0x1c, 0xf3, 0x30,
0x01, 0x72, 0x0f, 0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0xec, 0xfe, 0xf3, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xc4, 0xec, 0xbe,
0xc3, 0x13, 0x00, 0x00,
// 1586 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x72, 0xdc, 0xc4,
0x13, 0xb7, 0xf6, 0x7b, 0x7b, 0x3f, 0xbc, 0x3b, 0x76, 0x12, 0x79, 0xf3, 0x4f, 0xb2, 0x51, 0x2e,
0x9b, 0xfc, 0xc1, 0x04, 0x73, 0xe0, 0x00, 0x54, 0x2a, 0x71, 0x1c, 0x70, 0xc5, 0x49, 0x1c, 0x6d,
0x12, 0xaa, 0xa8, 0xa2, 0x84, 0x2c, 0x8d, 0x1d, 0x95, 0xb5, 0x92, 0xd0, 0xcc, 0x3a, 0xde, 0x5c,
0x38, 0xc0, 0x91, 0xe2, 0xc2, 0x4b, 0xf0, 0x10, 0x14, 0x17, 0x8e, 0x3c, 0x05, 0x4f, 0x40, 0x15,
0x77, 0xaa, 0xa8, 0xf9, 0x90, 0x34, 0xd2, 0xae, 0xed, 0x98, 0xaa, 0x1c, 0x72, 0x9b, 0xe9, 0xee,
0xf9, 0x4d, 0xcf, 0x6f, 0x7a, 0xba, 0x5b, 0x82, 0xf6, 0xc4, 0x26, 0x14, 0xc7, 0xeb, 0x51, 0x1c,
0xd2, 0x10, 0x35, 0xc5, 0xcc, 0x8a, 0xf6, 0x8c, 0x5f, 0xab, 0xd0, 0xfc, 0x02, 0xdb, 0x31, 0xdd,
0xc3, 0x36, 0x45, 0x5d, 0x28, 0x79, 0x91, 0xae, 0x0d, 0xb5, 0x51, 0xd3, 0x2c, 0x79, 0x11, 0x42,
0x50, 0x89, 0xc2, 0x98, 0xea, 0xa5, 0xa1, 0x36, 0xea, 0x98, 0x7c, 0x8c, 0xae, 0x00, 0x44, 0xd3,
0x3d, 0xdf, 0x73, 0xac, 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0x6c, 0x3f,
0xdf, 0x6a, 0x0f, 0xd6, 0xe6, 0x92, 0x4e, 0xd2, 0x99, 0x49, 0xc4, 0xa7, 0xd0, 0x56, 0x3b, 0xcc,
0x1c, 0xe0, 0x82, 0x7e, 0x78, 0x70, 0xed, 0x8c, 0xd6, 0xd4, 0x58, 0x42, 0x77, 0xa0, 0x26, 0x5a,
0x1e, 0xa4, 0x2b, 0xc6, 0xb9, 0x9e, 0x2e, 0xe7, 0x57, 0xbe, 0x3f, 0x32, 0x96, 0xd0, 0x43, 0x80,
0xac, 0x69, 0x40, 0x2a, 0x2f, 0x73, 0x5d, 0xcb, 0xe0, 0xca, 0x09, 0xda, 0x14, 0xec, 0x4b, 0xe8,
0xe6, 0xcb, 0x27, 0x1a, 0x2e, 0xac, 0x90, 0x4a, 0x0c, 0x0d, 0xae, 0x9f, 0x62, 0x91, 0x02, 0x7f,
0x0d, 0xbd, 0x62, 0x55, 0x44, 0xc6, 0xc2, 0x85, 0xb9, 0x0a, 0x3b, 0xb8, 0x71, 0xaa, 0x8d, 0x4a,
0x42, 0x16, 0xc6, 0x39, 0x12, 0xe6, 0x62, 0x3e, 0x47, 0xc2, 0x7c, 0xec, 0x1b, 0x4b, 0x7b, 0x35,
0xfe, 0x17, 0xf0, 0xa3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x18, 0x87, 0x1e, 0x54, 0x15, 0x14,
0x00, 0x00,
}

6
weed/storage/erasure_coding/ec_volume.go

@ -10,9 +10,11 @@ import (
"github.com/chrislusf/seaweedfs/weed/storage/needle"
)
type ShardId uint8
type EcVolumeShard struct {
VolumeId needle.VolumeId
ShardId uint8
ShardId ShardId
Collection string
dir string
ecdFile *os.File
@ -22,7 +24,7 @@ type EcVolumeShards []*EcVolumeShard
func NewEcVolumeShard(dirname string, collection string, id needle.VolumeId, shardId int) (v *EcVolumeShard, e error) {
v = &EcVolumeShard{dir: dirname, Collection: collection, VolumeId: id, ShardId: uint8(shardId)}
v = &EcVolumeShard{dir: dirname, Collection: collection, VolumeId: id, ShardId: ShardId(shardId)}
baseFileName := v.FileName()
if v.ecxFile, e = os.OpenFile(baseFileName+".ecx", os.O_RDONLY, 0644); e != nil {

46
weed/storage/erasure_coding/ec_volume_info.go

@ -0,0 +1,46 @@
package erasure_coding
import (
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
)
// data structure used in master
type EcVolumeInfo struct {
VolumeId needle.VolumeId
Collection string
shardIds uint16 // use bits to indicate the shard id
}
func (ecInfo *EcVolumeInfo) AddShardId(id ShardId) {
ecInfo.shardIds |= (1 << id)
}
func (ecInfo *EcVolumeInfo) RemoveShardId(id ShardId) {
ecInfo.shardIds &^= (1 << id)
}
func (ecInfo *EcVolumeInfo) HasShardId(id ShardId) bool {
return ecInfo.shardIds&(1<<id) > 0
}
func (ecInfo *EcVolumeInfo) ShardIds() (ret []ShardId) {
for i := ShardId(0); i < DataShardsCount+ParityShardsCount; i++ {
if ecInfo.HasShardId(i) {
ret = append(ret, i)
}
}
return
}
func (ecInfo *EcVolumeInfo) ToVolumeEcShardInformationMessage() (ret []*master_pb.VolumeEcShardInformationMessage) {
for _, shard := range ecInfo.ShardIds() {
ret = append(ret, &master_pb.VolumeEcShardInformationMessage{
Id: uint32(ecInfo.VolumeId),
EcIndex: uint32(shard),
Collection: ecInfo.Collection,
})
}
return
}

18
weed/topology/data_node.go

@ -2,8 +2,10 @@ package topology
import (
"fmt"
"sync"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
"strconv"
@ -14,11 +16,13 @@ import (
type DataNode struct {
NodeImpl
volumes map[needle.VolumeId]storage.VolumeInfo
Ip string
Port int
PublicUrl string
LastSeen int64 // unix time in seconds
volumes map[needle.VolumeId]storage.VolumeInfo
Ip string
Port int
PublicUrl string
LastSeen int64 // unix time in seconds
ecShards map[needle.VolumeId]erasure_coding.EcVolumeInfo
ecShardsLock sync.RWMutex
}
func NewDataNode(id string) *DataNode {
@ -26,6 +30,7 @@ func NewDataNode(id string) *DataNode {
s.id = NodeId(id)
s.nodeType = "DataNode"
s.volumes = make(map[needle.VolumeId]storage.VolumeInfo)
s.ecShards = make(map[needle.VolumeId]erasure_coding.EcVolumeInfo)
s.NodeImpl.value = s
return s
}
@ -158,5 +163,8 @@ func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo {
for _, v := range dn.GetVolumes() {
m.VolumeInfos = append(m.VolumeInfos, v.ToVolumeInformationMessage())
}
for _, ecv := range dn.GetEcShards() {
m.EcShardInfos = append(m.EcShardInfos, ecv.ToVolumeEcShardInformationMessage()...)
}
return m
}

14
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
}
Loading…
Cancel
Save