diff --git a/pool/pool.go b/pool/pool.go index 28715ac6..f7abf4c5 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -615,7 +615,7 @@ func (c *clientWrapper) objectPut(ctx context.Context, prm PrmObjectPut) (oid.ID } var cliPrm sdkClient.PrmObjectPutInit - cliPrm.SetCopiesNumber(prm.copiesNumber) // TODO(@ironbee): adopt multiple copy number https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/44 + cliPrm.SetCopiesNumberByVectors(prm.copiesNumber) if prm.stoken != nil { cliPrm.WithinSession(*prm.stoken) } @@ -1257,7 +1257,7 @@ type PrmObjectPut struct { payload io.Reader - copiesNumber uint32 + copiesNumber []uint32 } // SetHeader specifies header of the object. @@ -1273,6 +1273,12 @@ func (x *PrmObjectPut) SetPayload(payload io.Reader) { // SetCopiesNumber sets number of object copies that is enough to consider put successful. // Zero means using default behavior. func (x *PrmObjectPut) SetCopiesNumber(copiesNumber uint32) { + x.copiesNumber = []uint32{copiesNumber} +} + +// SetCopiesNumberVector sets number of object copies that is enough to consider put successful, provided as array. +// Nil/empty vector means using default behavior. +func (x *PrmObjectPut) SetCopiesNumberVector(copiesNumber []uint32) { x.copiesNumber = copiesNumber }