prepare to register ec shard info in master

This commit is contained in:
Chris Lu
2019-05-23 00:42:28 -07:00
parent e913ee380a
commit 4659d80035
5 changed files with 65 additions and 5 deletions

View File

@@ -12,6 +12,13 @@ type EcVolumeInfo struct {
shardIds uint16 // use bits to indicate the shard id
}
func NewEcVolumeInfo(collection string, vid needle.VolumeId) *EcVolumeInfo {
return &EcVolumeInfo{
Collection: collection,
VolumeId: vid,
}
}
func (ecInfo *EcVolumeInfo) AddShardId(id ShardId) {
ecInfo.shardIds |= (1 << id)
}