[#44] pool: Add copies number vector when putting object
Signed-off-by: Artem Tataurov <a.tataurov@yadro.com>
This commit is contained in:
parent
db5b89496d
commit
d0762d037d
1 changed files with 8 additions and 2 deletions
10
pool/pool.go
10
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue