forked from TrueCloudLab/frostfs-node
[#645] object/put: Pass NodeInfo instead of AddressGroup to relay func
Replace `network.AddressGroup` parameter type of relay function with `client.NodeInfo`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e473f3ac91
commit
3a497a3c53
3 changed files with 6 additions and 8 deletions
|
@ -3,7 +3,6 @@ package putsvc
|
|||
import (
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement"
|
||||
)
|
||||
|
@ -15,7 +14,7 @@ type PutInitPrm struct {
|
|||
|
||||
traverseOpts []placement.Option
|
||||
|
||||
relay func(network.AddressGroup, client.Client) error
|
||||
relay func(client.NodeInfo, client.Client) error
|
||||
}
|
||||
|
||||
type PutChunkPrm struct {
|
||||
|
@ -46,7 +45,7 @@ func (p *PutInitPrm) WithObject(v *object.RawObject) *PutInitPrm {
|
|||
return p
|
||||
}
|
||||
|
||||
func (p *PutInitPrm) WithRelay(f func(network.AddressGroup, client.Client) error) *PutInitPrm {
|
||||
func (p *PutInitPrm) WithRelay(f func(client.NodeInfo, client.Client) error) *PutInitPrm {
|
||||
if p != nil {
|
||||
p.relay = f
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/client"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/transformer"
|
||||
|
@ -20,7 +19,7 @@ type Streamer struct {
|
|||
|
||||
target transformer.ObjectTarget
|
||||
|
||||
relay func(network.AddressGroup, client.Client) error
|
||||
relay func(client.NodeInfo, client.Client) error
|
||||
|
||||
maxPayloadSz uint64 // network config
|
||||
}
|
||||
|
@ -157,7 +156,7 @@ func (p *Streamer) newCommonTarget(prm *PutInitPrm) transformer.ObjectTarget {
|
|||
return fmt.Errorf("could not create SDK client %s: %w", info.AddressGroup(), err)
|
||||
}
|
||||
|
||||
return p.relay(info.AddressGroup(), c)
|
||||
return p.relay(info, c)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,13 +125,13 @@ func (s *streamer) CloseAndRecv() (*object.PutResponse, error) {
|
|||
return fromPutResponse(resp), nil
|
||||
}
|
||||
|
||||
func (s *streamer) relayRequest(addr network.AddressGroup, c client.Client) error {
|
||||
func (s *streamer) relayRequest(info client.NodeInfo, c client.Client) error {
|
||||
// open stream
|
||||
resp := new(object.PutResponse)
|
||||
|
||||
var firstErr error
|
||||
|
||||
addr.IterateAddresses(func(addr network.Address) (stop bool) {
|
||||
info.AddressGroup().IterateAddresses(func(addr network.Address) (stop bool) {
|
||||
var err error
|
||||
|
||||
defer func() {
|
||||
|
|
Loading…
Reference in a new issue