diff --git a/pkg/services/object/put/distributed.go b/pkg/services/object/put/distributed.go index 4740ad1fe..df01be9bf 100644 --- a/pkg/services/object/put/distributed.go +++ b/pkg/services/object/put/distributed.go @@ -10,8 +10,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object" svcutil "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object_manager/placement" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/transformer" "go.uber.org/zap" @@ -27,17 +25,13 @@ type distributedTarget struct { obj *objectSDK.Object objMeta object.ContentMeta + *cfg + payload *payload nodeTargetInitializer func(nodeDesc) preparedObjectTarget - getWorkerPool func([]byte) (util.WorkerPool, bool) - relay func(context.Context, nodeDesc) error - - fmt *object.FormatValidator - - log *logger.Logger } // parameters and state of container traversal. @@ -137,7 +131,7 @@ func (t *distributedTarget) WriteObject(ctx context.Context, obj *objectSDK.Obje var err error - if t.objMeta, err = t.fmt.ValidateContent(t.obj); err != nil { + if t.objMeta, err = t.fmtValidator.ValidateContent(t.obj); err != nil { return fmt.Errorf("(%T) could not validate payload content: %w", t, err) } diff --git a/pkg/services/object/put/streamer.go b/pkg/services/object/put/streamer.go index 80b1c2541..1b5a926a1 100644 --- a/pkg/services/object/put/streamer.go +++ b/pkg/services/object/put/streamer.go @@ -215,13 +215,13 @@ func (p *Streamer) newCommonTarget(prm *PutInitPrm) *distributedTarget { withBroadcast := !prm.common.LocalOnly() && (typ == objectSDK.TypeTombstone || typ == objectSDK.TypeLock) return &distributedTarget{ + cfg: p.cfg, traversal: traversal{ opts: prm.traverseOpts, extraBroadcastEnabled: withBroadcast, }, - payload: getPayload(), - getWorkerPool: p.getWorkerPool, + payload: getPayload(), nodeTargetInitializer: func(node nodeDesc) preparedObjectTarget { if node.local { return localTarget{ @@ -240,8 +240,6 @@ func (p *Streamer) newCommonTarget(prm *PutInitPrm) *distributedTarget { return rt }, relay: relay, - fmt: p.fmtValidator, - log: p.log, } } @@ -279,9 +277,9 @@ func (p *Streamer) Close(ctx context.Context) (*PutResponse, error) { }, nil } -func (p *Streamer) getWorkerPool(pub []byte) (pkgutil.WorkerPool, bool) { - if p.netmapKeys.IsLocalKey(pub) { - return p.localPool, true +func (c *cfg) getWorkerPool(pub []byte) (pkgutil.WorkerPool, bool) { + if c.netmapKeys.IsLocalKey(pub) { + return c.localPool, true } - return p.remotePool, false + return c.remotePool, false }