forked from TrueCloudLab/frostfs-api-go
[#235] v2/audit: Regenerate protobuf
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1c25c3904b
commit
aafeb70bdb
8 changed files with 166 additions and 28 deletions
|
@ -124,6 +124,34 @@ func (r *Result) SetComplete(v bool) {
|
||||||
SetComplete(v)
|
SetComplete(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Requests returns number of requests made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (r *Result) Requests() uint32 {
|
||||||
|
return (*audit.DataAuditResult)(r).
|
||||||
|
GetRequests()
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRequests sets number of requests made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (r *Result) SetRequests(v uint32) {
|
||||||
|
(*audit.DataAuditResult)(r).
|
||||||
|
SetRequests(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retries returns number of retries made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (r *Result) Retries() uint32 {
|
||||||
|
return (*audit.DataAuditResult)(r).
|
||||||
|
GetRetries()
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRetries sets number of retries made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (r *Result) SetRetries(v uint32) {
|
||||||
|
(*audit.DataAuditResult)(r).
|
||||||
|
SetRetries(v)
|
||||||
|
}
|
||||||
|
|
||||||
// PassSG returns list of Storage Groups that passed audit PoR stage.
|
// PassSG returns list of Storage Groups that passed audit PoR stage.
|
||||||
func (r *Result) PassSG() []*object.ID {
|
func (r *Result) PassSG() []*object.ID {
|
||||||
mV2 := (*audit.DataAuditResult)(r).
|
mV2 := (*audit.DataAuditResult)(r).
|
||||||
|
|
|
@ -50,6 +50,14 @@ func TestResult(t *testing.T) {
|
||||||
r.SetComplete(true)
|
r.SetComplete(true)
|
||||||
require.True(t, r.Complete())
|
require.True(t, r.Complete())
|
||||||
|
|
||||||
|
requests := uint32(2)
|
||||||
|
r.SetRequests(requests)
|
||||||
|
require.Equal(t, requests, r.Requests())
|
||||||
|
|
||||||
|
retries := uint32(1)
|
||||||
|
r.SetRetries(retries)
|
||||||
|
require.Equal(t, retries, r.Retries())
|
||||||
|
|
||||||
passSG := []*object.ID{testOID(), testOID()}
|
passSG := []*object.ID{testOID(), testOID()}
|
||||||
r.SetPassSG(passSG)
|
r.SetPassSG(passSG)
|
||||||
require.Equal(t, passSG, r.PassSG())
|
require.Equal(t, passSG, r.PassSG())
|
||||||
|
@ -86,6 +94,8 @@ func TestStorageGroupEncoding(t *testing.T) {
|
||||||
r.SetPublicKey([]byte{1, 2, 3})
|
r.SetPublicKey([]byte{1, 2, 3})
|
||||||
r.SetPassSG([]*object.ID{testOID(), testOID()})
|
r.SetPassSG([]*object.ID{testOID(), testOID()})
|
||||||
r.SetFailSG([]*object.ID{testOID(), testOID()})
|
r.SetFailSG([]*object.ID{testOID(), testOID()})
|
||||||
|
r.SetRequests(3)
|
||||||
|
r.SetRetries(2)
|
||||||
r.SetHit(1)
|
r.SetHit(1)
|
||||||
r.SetMiss(2)
|
r.SetMiss(2)
|
||||||
r.SetFail(3)
|
r.SetFail(3)
|
||||||
|
|
|
@ -36,6 +36,9 @@ func DataAuditResultToGRPCMessage(a *DataAuditResult) *audit.DataAuditResult {
|
||||||
refs.ObjectIDListToGRPCMessage(a.GetFailSG()),
|
refs.ObjectIDListToGRPCMessage(a.GetFailSG()),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
m.SetRequests(a.GetRequests())
|
||||||
|
m.SetRetries(a.GetRetries())
|
||||||
|
|
||||||
m.SetHit(a.GetHit())
|
m.SetHit(a.GetHit())
|
||||||
m.SetMiss(a.GetMiss())
|
m.SetMiss(a.GetMiss())
|
||||||
m.SetFail(a.GetFail())
|
m.SetFail(a.GetFail())
|
||||||
|
@ -77,6 +80,9 @@ func DataAuditResultFromGRPCMessage(m *audit.DataAuditResult) *DataAuditResult {
|
||||||
refs.ObjectIDListFromGRPCMessage(m.GetFailSg()),
|
refs.ObjectIDListFromGRPCMessage(m.GetFailSg()),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
a.SetRequests(m.GetRequests())
|
||||||
|
a.SetRetries(m.GetRetries())
|
||||||
|
|
||||||
a.SetHit(m.GetHit())
|
a.SetHit(m.GetHit())
|
||||||
a.SetMiss(m.GetMiss())
|
a.SetMiss(m.GetMiss())
|
||||||
a.SetFail(m.GetFail())
|
a.SetFail(m.GetFail())
|
||||||
|
|
|
@ -39,6 +39,20 @@ func (x *DataAuditResult) SetComplete(v bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetRequests is a Requests field setter.
|
||||||
|
func (x *DataAuditResult) SetRequests(v uint32) {
|
||||||
|
if x != nil {
|
||||||
|
x.Requests = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRetries is a Retries field setter.
|
||||||
|
func (x *DataAuditResult) SetRetries(v uint32) {
|
||||||
|
if x != nil {
|
||||||
|
x.Retries = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// SetPassSg is a PassSg field setter.
|
// SetPassSg is a PassSg field setter.
|
||||||
func (x *DataAuditResult) SetPassSg(v []*refs.ObjectID) {
|
func (x *DataAuditResult) SetPassSg(v []*refs.ObjectID) {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
|
|
78
v2/audit/grpc/types.pb.go
generated
78
v2/audit/grpc/types.pb.go
generated
|
@ -44,24 +44,28 @@ type DataAuditResult struct {
|
||||||
PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||||
// Shows if Data Audit process was complete in time or if it was cancelled
|
// Shows if Data Audit process was complete in time or if it was cancelled
|
||||||
Complete bool `protobuf:"varint,5,opt,name=complete,proto3" json:"complete,omitempty"`
|
Complete bool `protobuf:"varint,5,opt,name=complete,proto3" json:"complete,omitempty"`
|
||||||
|
// Number of request done at PoR stage
|
||||||
|
Requests uint32 `protobuf:"varint,6,opt,name=requests,proto3" json:"requests,omitempty"`
|
||||||
|
// Number of retries done at PoR stage
|
||||||
|
Retries uint32 `protobuf:"varint,7,opt,name=retries,proto3" json:"retries,omitempty"`
|
||||||
// List of Storage Groups that passed audit PoR stage
|
// List of Storage Groups that passed audit PoR stage
|
||||||
PassSg []*grpc.ObjectID `protobuf:"bytes,6,rep,name=pass_sg,json=passSG,proto3" json:"pass_sg,omitempty"`
|
PassSg []*grpc.ObjectID `protobuf:"bytes,8,rep,name=pass_sg,json=passSG,proto3" json:"pass_sg,omitempty"`
|
||||||
// List of Storage Groups that failed audit PoR stage
|
// List of Storage Groups that failed audit PoR stage
|
||||||
FailSg []*grpc.ObjectID `protobuf:"bytes,7,rep,name=fail_sg,json=failSG,proto3" json:"fail_sg,omitempty"`
|
FailSg []*grpc.ObjectID `protobuf:"bytes,9,rep,name=fail_sg,json=failSG,proto3" json:"fail_sg,omitempty"`
|
||||||
// Number of sampled objects under audit placed in an optimal way according to
|
// Number of sampled objects under audit placed in an optimal way according to
|
||||||
// the containers placement policy when checking PoP
|
// the containers placement policy when checking PoP
|
||||||
Hit uint32 `protobuf:"varint,8,opt,name=hit,proto3" json:"hit,omitempty"`
|
Hit uint32 `protobuf:"varint,10,opt,name=hit,proto3" json:"hit,omitempty"`
|
||||||
// Number of sampled objects under audit placed in suboptimal way according to
|
// Number of sampled objects under audit placed in suboptimal way according to
|
||||||
// the containers placement policy, but still at a satisfactory level when
|
// the containers placement policy, but still at a satisfactory level when
|
||||||
// checking PoP
|
// checking PoP
|
||||||
Miss uint32 `protobuf:"varint,9,opt,name=miss,proto3" json:"miss,omitempty"`
|
Miss uint32 `protobuf:"varint,11,opt,name=miss,proto3" json:"miss,omitempty"`
|
||||||
// Number of sampled objects under audit stored in a way not confirming
|
// Number of sampled objects under audit stored in a way not confirming
|
||||||
// placement policy or not found at all when checking PoP
|
// placement policy or not found at all when checking PoP
|
||||||
Fail uint32 `protobuf:"varint,10,opt,name=fail,proto3" json:"fail,omitempty"`
|
Fail uint32 `protobuf:"varint,12,opt,name=fail,proto3" json:"fail,omitempty"`
|
||||||
// List of storage node public keys that passed at least one PDP
|
// List of storage node public keys that passed at least one PDP
|
||||||
PassNodes [][]byte `protobuf:"bytes,11,rep,name=pass_nodes,json=passNodes,proto3" json:"pass_nodes,omitempty"`
|
PassNodes [][]byte `protobuf:"bytes,13,rep,name=pass_nodes,json=passNodes,proto3" json:"pass_nodes,omitempty"`
|
||||||
// List of storage node public keys that failed at least one PDP
|
// List of storage node public keys that failed at least one PDP
|
||||||
FailNodes [][]byte `protobuf:"bytes,12,rep,name=fail_nodes,json=failNodes,proto3" json:"fail_nodes,omitempty"`
|
FailNodes [][]byte `protobuf:"bytes,14,rep,name=fail_nodes,json=failNodes,proto3" json:"fail_nodes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DataAuditResult) Reset() {
|
func (x *DataAuditResult) Reset() {
|
||||||
|
@ -131,6 +135,20 @@ func (x *DataAuditResult) GetComplete() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DataAuditResult) GetRequests() uint32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Requests
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DataAuditResult) GetRetries() uint32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Retries
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
func (x *DataAuditResult) GetPassSg() []*grpc.ObjectID {
|
func (x *DataAuditResult) GetPassSg() []*grpc.ObjectID {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.PassSg
|
return x.PassSg
|
||||||
|
@ -187,7 +205,7 @@ var file_v2_audit_grpc_types_proto_rawDesc = []byte{
|
||||||
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6e, 0x65, 0x6f,
|
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6e, 0x65, 0x6f,
|
||||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x1a, 0x18, 0x76, 0x32,
|
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x1a, 0x18, 0x76, 0x32,
|
||||||
0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
|
0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x03, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x41,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf4, 0x03, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x41,
|
||||||
0x75, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65,
|
0x75, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x07, 0x76, 0x65,
|
||||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65,
|
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65,
|
||||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72,
|
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x56, 0x65, 0x72,
|
||||||
|
@ -201,26 +219,30 @@ var file_v2_audit_grpc_types_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01,
|
0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a,
|
0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a,
|
||||||
0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52,
|
0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||||
0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x70, 0x61, 0x73,
|
0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71,
|
||||||
0x73, 0x5f, 0x73, 0x67, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f,
|
0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x71,
|
||||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65,
|
0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73,
|
||||||
0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x53, 0x47, 0x12, 0x31, 0x0a, 0x07,
|
0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12,
|
||||||
0x66, 0x61, 0x69, 0x6c, 0x5f, 0x73, 0x67, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
|
0x31, 0x0a, 0x07, 0x70, 0x61, 0x73, 0x73, 0x5f, 0x73, 0x67, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b,
|
||||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f,
|
0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66,
|
||||||
0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x53, 0x47, 0x12,
|
0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73,
|
||||||
0x10, 0x0a, 0x03, 0x68, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x68, 0x69,
|
0x53, 0x47, 0x12, 0x31, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x73, 0x67, 0x18, 0x09, 0x20,
|
||||||
0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x69, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||||
0x04, 0x6d, 0x69, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x18, 0x0a, 0x20,
|
0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x66,
|
||||||
0x01, 0x28, 0x0d, 0x52, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x73,
|
0x61, 0x69, 0x6c, 0x53, 0x47, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01,
|
||||||
0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x70,
|
0x28, 0x0d, 0x52, 0x03, 0x68, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x69, 0x73, 0x73, 0x18,
|
||||||
0x61, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c,
|
0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x6d, 0x69, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66,
|
||||||
0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x61,
|
0x61, 0x69, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x12,
|
||||||
0x69, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x4c, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0d, 0x20,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f,
|
0x03, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1d,
|
||||||
0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f,
|
0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03,
|
||||||
0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74,
|
0x28, 0x0c, 0x52, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x4c, 0x5a,
|
||||||
0xaa, 0x02, 0x12, 0x4e, 0x65, 0x6f, 0x46, 0x53, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x76, 0x32, 0x2e,
|
0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63,
|
||||||
0x41, 0x75, 0x64, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d,
|
||||||
|
0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
||||||
|
0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0xaa, 0x02, 0x12, 0x4e, 0x65, 0x6f, 0x46, 0x53, 0x2e, 0x41,
|
||||||
|
0x50, 0x49, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -14,6 +14,8 @@ const (
|
||||||
cidFNum
|
cidFNum
|
||||||
pubKeyFNum
|
pubKeyFNum
|
||||||
completeFNum
|
completeFNum
|
||||||
|
requestsFNum
|
||||||
|
retriesFNum
|
||||||
passSGFNum
|
passSGFNum
|
||||||
failSGFNum
|
failSGFNum
|
||||||
hitFNum
|
hitFNum
|
||||||
|
@ -74,6 +76,20 @@ func (a *DataAuditResult) StableMarshal(buf []byte) ([]byte, error) {
|
||||||
|
|
||||||
offset += n
|
offset += n
|
||||||
|
|
||||||
|
n, err = proto.UInt32Marshal(requestsFNum, buf[offset:], a.requests)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += n
|
||||||
|
|
||||||
|
n, err = proto.UInt32Marshal(retriesFNum, buf[offset:], a.retries)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += n
|
||||||
|
|
||||||
n, err = refs.ObjectIDNestedListMarshal(passSGFNum, buf[offset:], a.passSG)
|
n, err = refs.ObjectIDNestedListMarshal(passSGFNum, buf[offset:], a.passSG)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -136,6 +152,8 @@ func (a *DataAuditResult) StableSize() (size int) {
|
||||||
size += proto.NestedStructureSize(cidFNum, a.cid)
|
size += proto.NestedStructureSize(cidFNum, a.cid)
|
||||||
size += proto.BytesSize(pubKeyFNum, a.pubKey)
|
size += proto.BytesSize(pubKeyFNum, a.pubKey)
|
||||||
size += proto.BoolSize(completeFNum, a.complete)
|
size += proto.BoolSize(completeFNum, a.complete)
|
||||||
|
size += proto.UInt32Size(requestsFNum, a.requests)
|
||||||
|
size += proto.UInt32Size(retriesFNum, a.retries)
|
||||||
size += refs.ObjectIDNestedListSize(passSGFNum, a.passSG)
|
size += refs.ObjectIDNestedListSize(passSGFNum, a.passSG)
|
||||||
size += refs.ObjectIDNestedListSize(failSGFNum, a.failSG)
|
size += refs.ObjectIDNestedListSize(failSGFNum, a.failSG)
|
||||||
size += proto.UInt32Size(hitFNum, a.hit)
|
size += proto.UInt32Size(hitFNum, a.hit)
|
||||||
|
|
|
@ -43,6 +43,8 @@ func generateDataAuditResult() *audit.DataAuditResult {
|
||||||
a.SetContainerID(cid)
|
a.SetContainerID(cid)
|
||||||
a.SetPublicKey([]byte("Public key"))
|
a.SetPublicKey([]byte("Public key"))
|
||||||
a.SetComplete(true)
|
a.SetComplete(true)
|
||||||
|
a.SetRequests(10)
|
||||||
|
a.SetRetries(9)
|
||||||
a.SetPassSG([]*refs.ObjectID{oid1, oid2})
|
a.SetPassSG([]*refs.ObjectID{oid1, oid2})
|
||||||
a.SetFailSG([]*refs.ObjectID{oid2, oid1})
|
a.SetFailSG([]*refs.ObjectID{oid2, oid1})
|
||||||
a.SetHit(1)
|
a.SetHit(1)
|
||||||
|
|
|
@ -11,6 +11,8 @@ type DataAuditResult struct {
|
||||||
|
|
||||||
auditEpoch uint64
|
auditEpoch uint64
|
||||||
|
|
||||||
|
requests, retries uint32
|
||||||
|
|
||||||
hit, miss, fail uint32
|
hit, miss, fail uint32
|
||||||
|
|
||||||
cid *refs.ContainerID
|
cid *refs.ContainerID
|
||||||
|
@ -120,6 +122,42 @@ func (a *DataAuditResult) SetFailSG(v []*refs.ObjectID) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetRequests returns number of requests made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (a *DataAuditResult) GetRequests() uint32 {
|
||||||
|
if a != nil {
|
||||||
|
return a.requests
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRequests sets number of requests made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (a *DataAuditResult) SetRequests(v uint32) {
|
||||||
|
if a != nil {
|
||||||
|
a.requests = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRetries returns number of retries made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (a *DataAuditResult) GetRetries() uint32 {
|
||||||
|
if a != nil {
|
||||||
|
return a.retries
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRetries sets number of retries made by PoR audit check to get
|
||||||
|
// all headers of the objects inside storage groups.
|
||||||
|
func (a *DataAuditResult) SetRetries(v uint32) {
|
||||||
|
if a != nil {
|
||||||
|
a.retries = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GetHit returns number of sampled objects under audit placed
|
// GetHit returns number of sampled objects under audit placed
|
||||||
// in an optimal way according to the containers placement policy
|
// in an optimal way according to the containers placement policy
|
||||||
// when checking PoP.
|
// when checking PoP.
|
||||||
|
|
Loading…
Add table
Reference in a new issue