From 1b867e53d71086c1bd134deccbd88152a7b9b1cb Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 19 Nov 2020 11:21:58 +0300 Subject: [PATCH] [#186] replicator: Use new storage engine for work Signed-off-by: Leonard Lyubich --- pkg/services/replicator/process.go | 3 ++- pkg/services/replicator/replicator.go | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/services/replicator/process.go b/pkg/services/replicator/process.go index 5da3b46c3..c68d305fd 100644 --- a/pkg/services/replicator/process.go +++ b/pkg/services/replicator/process.go @@ -3,6 +3,7 @@ package replicator import ( "context" + "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine" "github.com/nspcc-dev/neofs-node/pkg/network" putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put" "go.uber.org/zap" @@ -48,7 +49,7 @@ func (p *Replicator) handleTask(ctx context.Context, task *Task) { ) }() - obj, err := p.localStorage.Get(task.addr) + obj, err := engine.Get(p.localStorage, task.addr) if err != nil { p.log.Error("could not get object from local storage") diff --git a/pkg/services/replicator/replicator.go b/pkg/services/replicator/replicator.go index 920003736..9fc1c1a82 100644 --- a/pkg/services/replicator/replicator.go +++ b/pkg/services/replicator/replicator.go @@ -3,7 +3,7 @@ package replicator import ( "time" - "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/localstore" + "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine" putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put" "github.com/nspcc-dev/neofs-node/pkg/util/logger" "go.uber.org/zap" @@ -29,7 +29,7 @@ type cfg struct { remoteSender *putsvc.RemoteSender - localStorage *localstore.Storage + localStorage *engine.StorageEngine } func defaultCfg() *cfg { @@ -73,7 +73,7 @@ func WithRemoteSender(v *putsvc.RemoteSender) Option { } // WithLocalStorage returns option to set local object storage of Replicator. -func WithLocalStorage(v *localstore.Storage) Option { +func WithLocalStorage(v *engine.StorageEngine) Option { return func(c *cfg) { c.localStorage = v }