From aafeb70bdbba01c36fb660613871c454f0653753 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 23 Dec 2020 18:45:00 +0300 Subject: [PATCH] [#235] v2/audit: Regenerate protobuf Signed-off-by: Alex Vanin --- pkg/audit/result.go | 28 ++++++++++++++++++++++++++++ pkg/audit/result_test.go | 10 ++++++++++ v2/audit/convert.go | 6 ++++++ v2/audit/grpc/types.go | 14 ++++++++++++++ v2/audit/grpc/types.pb.go | Bin 11822 -> 12607 bytes v2/audit/marshal.go | 18 ++++++++++++++++++ v2/audit/marshal_test.go | 2 ++ v2/audit/types.go | 38 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 116 insertions(+) diff --git a/pkg/audit/result.go b/pkg/audit/result.go index 6f5ea9f5..9ebb564e 100644 --- a/pkg/audit/result.go +++ b/pkg/audit/result.go @@ -124,6 +124,34 @@ func (r *Result) SetComplete(v bool) { 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. func (r *Result) PassSG() []*object.ID { mV2 := (*audit.DataAuditResult)(r). diff --git a/pkg/audit/result_test.go b/pkg/audit/result_test.go index 57038a34..af4a497e 100644 --- a/pkg/audit/result_test.go +++ b/pkg/audit/result_test.go @@ -50,6 +50,14 @@ func TestResult(t *testing.T) { r.SetComplete(true) 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()} r.SetPassSG(passSG) require.Equal(t, passSG, r.PassSG()) @@ -86,6 +94,8 @@ func TestStorageGroupEncoding(t *testing.T) { r.SetPublicKey([]byte{1, 2, 3}) r.SetPassSG([]*object.ID{testOID(), testOID()}) r.SetFailSG([]*object.ID{testOID(), testOID()}) + r.SetRequests(3) + r.SetRetries(2) r.SetHit(1) r.SetMiss(2) r.SetFail(3) diff --git a/v2/audit/convert.go b/v2/audit/convert.go index 43849533..6402041c 100644 --- a/v2/audit/convert.go +++ b/v2/audit/convert.go @@ -36,6 +36,9 @@ func DataAuditResultToGRPCMessage(a *DataAuditResult) *audit.DataAuditResult { refs.ObjectIDListToGRPCMessage(a.GetFailSG()), ) + m.SetRequests(a.GetRequests()) + m.SetRetries(a.GetRetries()) + m.SetHit(a.GetHit()) m.SetMiss(a.GetMiss()) m.SetFail(a.GetFail()) @@ -77,6 +80,9 @@ func DataAuditResultFromGRPCMessage(m *audit.DataAuditResult) *DataAuditResult { refs.ObjectIDListFromGRPCMessage(m.GetFailSg()), ) + a.SetRequests(m.GetRequests()) + a.SetRetries(m.GetRetries()) + a.SetHit(m.GetHit()) a.SetMiss(m.GetMiss()) a.SetFail(m.GetFail()) diff --git a/v2/audit/grpc/types.go b/v2/audit/grpc/types.go index 2c225efb..d8dd0d12 100644 --- a/v2/audit/grpc/types.go +++ b/v2/audit/grpc/types.go @@ -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. func (x *DataAuditResult) SetPassSg(v []*refs.ObjectID) { if x != nil { diff --git a/v2/audit/grpc/types.pb.go b/v2/audit/grpc/types.pb.go index 32daf3a10fdb5ad6dd5ab1b126dc639768317b0a..dddc4412c9966c37c8c54482a5c7ba1b812ab5db 100644 GIT binary patch delta 906 zcmbVJKWGzS6z2|`++C`zwV`Qpf8O1pu{DvqT$;2RL2wj`X3(Xm7ke!V&DGo$LKbrHnPK@i+K>G!@1v7n1CAMf{j@BQBIz3;`+cI#y?U0&Q+ zYXuz$SD+Kz*a)H+mcw=cehlZrCPcBn8YprzNkw>D&d=0J;d)$Z`)k3eK}%Fx?}Tya zS#UiH+b666ja!P!;<$4yi2kn1QzUw{zE_mfe`qGf-E>=+$1&-Nuz)@3D_+TrVpskl zx-LFcJ_r?TWgZJ2?q+&Iwf}td+lVwY-#&EYH-Ll3)6K*ivcxcEd>;-EA-apcXmL+`TGI=$}5yzlPR#p3i#PY!~{ps_X)RBU(3w*G~DAcAOU57Q)? z!m%NcXe)>i8X9VEXz2S+m+$?a=lwnJ`;HpDYJU*KzPN^QXor*#6|YDcx8f&paW4Im z3c3p~#6~N8M)LRz4@hCyTl^A+Rrzr~&}a?QYE8gXiUuSRKPk#aM06E3YQb6E#GbZ} zF^%))jqX7=;$0fys&479=?dF5#h1C+rXF@RDijZMOkL_OnwF|LIo<9Q%lyq3Sc4Ut z3%iaJBN=r4zl({g;M)kxK3?+OQpLy1Ma0Y`?hH-fvC0e$@s-yGMZ(l@Y$l@9Np(K2 zVDk&!S@X!$hz^)0r|(UNG}y%o<}8^Tla!2{m1V?%