[#70] netmap: Regenerate protobuf for Replica

* Since EC field tags are renumerated, it is required
  to regenerate netmap grpc.
* Add a generator with EC replica to check it with
  unit-test.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-03-27 12:56:03 +03:00
parent 6e9d385f3c
commit 491a47e7fe
2 changed files with 16 additions and 4 deletions

View file

@ -402,9 +402,9 @@ type Replica struct {
// Named selector bucket to put replicas
Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"`
// Data shards count
EcDataCount uint32 `protobuf:"varint,6,opt,name=ec_data_count,json=ecDataCount,proto3" json:"ec_data_count,omitempty"`
EcDataCount uint32 `protobuf:"varint,3,opt,name=ec_data_count,json=ecDataCount,proto3" json:"ec_data_count,omitempty"`
// Parity shards count
EcParityCount uint32 `protobuf:"varint,7,opt,name=ec_parity_count,json=ecParityCount,proto3" json:"ec_parity_count,omitempty"`
EcParityCount uint32 `protobuf:"varint,4,opt,name=ec_parity_count,json=ecParityCount,proto3" json:"ec_parity_count,omitempty"`
}
func (x *Replica) Reset() {
@ -1081,9 +1081,9 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
0x12, 0x22, 0x0a, 0x0d, 0x65, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x43,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74,
0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65,
0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65,
0x63, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x86, 0x02, 0x0a,
0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03,

View file

@ -81,6 +81,17 @@ func GenerateReplica(empty bool) *netmap.Replica {
return m
}
func GenerateEC(empty bool) *netmap.Replica {
m := new(netmap.Replica)
if !empty {
m.SetECDataCount(4)
m.SetECParityCount(2)
}
return m
}
func GenerateReplicas(empty bool) []netmap.Replica {
var res []netmap.Replica
@ -88,6 +99,7 @@ func GenerateReplicas(empty bool) []netmap.Replica {
res = append(res,
*GenerateReplica(false),
*GenerateReplica(false),
*GenerateEC(false),
)
}