diff --git a/pkg/services/object/rangehash/local.go b/pkg/services/object/rangehash/local.go index 813e7d460..2f3f7f1c8 100644 --- a/pkg/services/object/rangehash/local.go +++ b/pkg/services/object/rangehash/local.go @@ -7,18 +7,22 @@ import ( "hash" "github.com/nspcc-dev/neofs-api-go/pkg" - "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/localstore" + "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine" "github.com/nspcc-dev/neofs-node/pkg/util" "github.com/nspcc-dev/tzhash/tz" "github.com/pkg/errors" ) type localHasher struct { - storage *localstore.Storage + storage *engine.StorageEngine } func (h *localHasher) hashRange(ctx context.Context, prm *Prm, handler func([][]byte)) error { - obj, err := h.storage.Get(prm.addr) + // FIXME: get partial range instead of full object. + // Current solution is simple, but more loaded + // We can calculate left and right border between all ranges + // and request bordered range (look Service.GetRangeHash). + obj, err := engine.Get(h.storage, prm.addr) if err != nil { return errors.Wrapf(err, "(%T) could not get object from local storage", h) } diff --git a/pkg/services/object/rangehash/service.go b/pkg/services/object/rangehash/service.go index 35bc389e5..c2dd9ef5f 100644 --- a/pkg/services/object/rangehash/service.go +++ b/pkg/services/object/rangehash/service.go @@ -11,7 +11,7 @@ import ( "github.com/nspcc-dev/neofs-api-go/pkg/object" "github.com/nspcc-dev/neofs-node/pkg/core/container" "github.com/nspcc-dev/neofs-node/pkg/core/netmap" - "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/localstore" + "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/cache" headsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/head" @@ -32,7 +32,7 @@ type Option func(*cfg) type cfg struct { keyStorage *objutil.KeyStorage - localStore *localstore.Storage + localStore *engine.StorageEngine cnrSrc container.Source @@ -234,7 +234,7 @@ func WithKeyStorage(v *objutil.KeyStorage) Option { } } -func WithLocalStorage(v *localstore.Storage) Option { +func WithLocalStorage(v *engine.StorageEngine) Option { return func(c *cfg) { c.localStore = v }