forked from TrueCloudLab/frostfs-node
[#186] replicator: Use new storage engine for work
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9a4cd01eb8
commit
1b867e53d7
2 changed files with 5 additions and 4 deletions
|
@ -3,6 +3,7 @@ package replicator
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||||
putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put"
|
putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put"
|
||||||
"go.uber.org/zap"
|
"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 {
|
if err != nil {
|
||||||
p.log.Error("could not get object from local storage")
|
p.log.Error("could not get object from local storage")
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package replicator
|
||||||
import (
|
import (
|
||||||
"time"
|
"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"
|
putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
@ -29,7 +29,7 @@ type cfg struct {
|
||||||
|
|
||||||
remoteSender *putsvc.RemoteSender
|
remoteSender *putsvc.RemoteSender
|
||||||
|
|
||||||
localStorage *localstore.Storage
|
localStorage *engine.StorageEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
func defaultCfg() *cfg {
|
func defaultCfg() *cfg {
|
||||||
|
@ -73,7 +73,7 @@ func WithRemoteSender(v *putsvc.RemoteSender) Option {
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithLocalStorage returns option to set local object storage of Replicator.
|
// 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) {
|
return func(c *cfg) {
|
||||||
c.localStorage = v
|
c.localStorage = v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue