From e27d76e80400fe9532b1d765e8fe9ea33cbd28f9 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 26 Jan 2021 21:32:33 +0300 Subject: [PATCH] [#250] v2/container: Add epoch field to size announce body Signed-off-by: Alex Vanin --- v2/container/convert.go | 4 ++++ v2/container/grpc/service.go | 7 +++++++ v2/container/grpc/service.pb.go | Bin 123969 -> 124372 bytes v2/container/marshal.go | 13 +++++++++++-- v2/container/marshal_test.go | 1 + v2/container/test/client_test.go | 2 ++ v2/container/types.go | 16 ++++++++++++++++ 7 files changed, 41 insertions(+), 2 deletions(-) diff --git a/v2/container/convert.go b/v2/container/convert.go index d40813f6..386eb8e3 100644 --- a/v2/container/convert.go +++ b/v2/container/convert.go @@ -857,6 +857,8 @@ func UsedSpaceAnnouncementToGRPCMessage(a *UsedSpaceAnnouncement) *container.Ann m := new(container.AnnounceUsedSpaceRequest_Body_Announcement) + m.SetEpoch(a.GetEpoch()) + m.SetContainerId( refs.ContainerIDToGRPCMessage(a.GetContainerID()), ) @@ -873,6 +875,8 @@ func UsedSpaceAnnouncementFromGRPCMessage(m *container.AnnounceUsedSpaceRequest_ a := new(UsedSpaceAnnouncement) + a.SetEpoch(m.GetEpoch()) + a.SetContainerID( refs.ContainerIDFromGRPCMessage(m.GetContainerId()), ) diff --git a/v2/container/grpc/service.go b/v2/container/grpc/service.go index 98c5cc69..644ca3ab 100644 --- a/v2/container/grpc/service.go +++ b/v2/container/grpc/service.go @@ -354,6 +354,13 @@ func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerification } } +// SetEpoch sets epoch of the size estimation. +func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetEpoch(v uint64) { + if m != nil { + m.Epoch = v + } +} + // SetContainerId sets identifier of the container. func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetContainerId(v *refs.ContainerID) { if m != nil { diff --git a/v2/container/grpc/service.pb.go b/v2/container/grpc/service.pb.go index 2951a95b95a5c4e5e531dcfc69610ae7e3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