[#186] object/rangehash: Use new storage engine for work
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
1bce2a4e55
commit
9b32f131c0
2 changed files with 10 additions and 6 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue