From 565e230c8baa596db99108b7e786b705efd7552a Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 7 Apr 2023 18:29:22 +0300 Subject: [PATCH 1/2] [#46] go.mod: Update api-go version Signed-off-by: Pavel Karpy --- go.mod | 4 ++-- go.sum | Bin 73545 -> 73545 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index c757267..b62f9f5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.18 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.11.2-0.20230315095236-9dc375346703 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.11.2-0.20230407123205-e6522d62a879 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230307110621-19a8ef2d02fb git.frostfs.info/TrueCloudLab/hrw v1.2.0 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 @@ -15,7 +15,6 @@ require ( github.com/stretchr/testify v1.8.1 go.uber.org/atomic v1.10.0 go.uber.org/zap v1.24.0 - google.golang.org/grpc v1.48.0 ) require ( @@ -39,6 +38,7 @@ require ( golang.org/x/sys v0.3.0 // indirect golang.org/x/text v0.5.0 // indirect google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect + google.golang.org/grpc v1.48.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f5990f283ef21eef1ee0605e699f484f75f4a60a..bd945828834e8786ed1ed0b4937bd0ee4f4e5db0 100644 GIT binary patch delta 119 zcmX@PkLBb(mJL(5T}=$k4ULSA3`})X%}kAqQp}7JEzB(yG7PP}GqWQ6{lhaNB25iS zd|mP*ON)cdqq3v?DpCVd3`&v%Jqv@&&62&6g0d$U@@h=3=9U!0Zd$Ve&vpYIMoD1+ D!AK(g delta 119 zcmX@PkLBb(mJL(5U5yP*4J=KKjLmc{Q<9C%O^r>=%nghcG7PP9DpCzxN}>w&OWmTv zqDn0j3o6X~lRYDxy^6B~oqSXD-NRBN-Mt-+%N-{d@@h=3=9U!0Zd$Ve&vpYIMoD1+ Dn@J)M -- 2.45.2 From 113271b205c772eaa032505eff2b2639ced41eb1 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 7 Apr 2023 18:40:54 +0300 Subject: [PATCH 2/2] [#46] client: Allow set `copy_number` for every placement vector Signed-off-by: Pavel Karpy --- client/object_put.go | 11 +++++++++-- pool/pool.go | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/object_put.go b/client/object_put.go index f25e44b..5995683 100644 --- a/client/object_put.go +++ b/client/object_put.go @@ -22,14 +22,21 @@ import ( // PrmObjectPutInit groups parameters of ObjectPutInit operation. type PrmObjectPutInit struct { - copyNum uint32 + copyNum []uint32 key *ecdsa.PrivateKey meta v2session.RequestMetaHeader } // SetCopiesNumber sets number of object copies that is enough to consider put successful. func (x *PrmObjectPutInit) SetCopiesNumber(copiesNumber uint32) { - x.copyNum = copiesNumber + x.copyNum = []uint32{copiesNumber} +} + +// SetCopiesNumberByVectors sets ordered list of minimal required object copies numbers +// per placement vector. List's length MUST equal container's placement vector number, +// otherwise request will fail. +func (x *PrmObjectPutInit) SetCopiesNumberByVectors(copiesNumbers []uint32) { + x.copyNum = copiesNumbers } // ResObjectPut groups the final result values of ObjectPutInit operation. diff --git a/pool/pool.go b/pool/pool.go index 772afc1..2776bd1 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -617,7 +617,7 @@ func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (oid.ID } var cliPrm sdkClient.PrmObjectPutInit - cliPrm.SetCopiesNumber(prm.copiesNumber) + cliPrm.SetCopiesNumber(prm.copiesNumber) // TODO(@ironbee): adopt multiple copy number https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/44 if prm.stoken != nil { cliPrm.WithinSession(*prm.stoken) } -- 2.45.2