forked from TrueCloudLab/frostfs-node
[#1318] node: Use new tombstone handling
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
24ca8ca5c7
commit
a275a71a87
2 changed files with 21 additions and 1 deletions
|
@ -35,6 +35,9 @@ import (
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/network/cache"
|
"github.com/nspcc-dev/neofs-node/pkg/network/cache"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/services/control"
|
"github.com/nspcc-dev/neofs-node/pkg/services/control"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/acl/eacl"
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/acl/eacl"
|
||||||
|
getsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/get"
|
||||||
|
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/tombstone"
|
||||||
|
tsourse "github.com/nspcc-dev/neofs-node/pkg/services/object_manager/tombstone/source"
|
||||||
trustcontroller "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/controller"
|
trustcontroller "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/controller"
|
||||||
truststorage "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/storage"
|
truststorage "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/storage"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/services/util/response"
|
"github.com/nspcc-dev/neofs-node/pkg/services/util/response"
|
||||||
|
@ -175,6 +178,8 @@ type cfgNodeInfo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type cfgObject struct {
|
type cfgObject struct {
|
||||||
|
getSvc *getsvc.Service
|
||||||
|
|
||||||
cnrSource container.Source
|
cnrSource container.Source
|
||||||
|
|
||||||
eaclSource eacl.Source
|
eaclSource eacl.Source
|
||||||
|
@ -346,8 +351,21 @@ func initLocalStorage(c *cfg) {
|
||||||
|
|
||||||
ls := engine.New(engineOpts...)
|
ls := engine.New(engineOpts...)
|
||||||
|
|
||||||
|
// allocate memory for the service;
|
||||||
|
// service will be created later
|
||||||
|
c.cfgObject.getSvc = new(getsvc.Service)
|
||||||
|
|
||||||
|
var tssPrm tsourse.TombstoneSourcePrm
|
||||||
|
tssPrm.SetGetService(c.cfgObject.getSvc)
|
||||||
|
tombstoneSrc := tsourse.NewSource(tssPrm)
|
||||||
|
|
||||||
|
tombstoneSource := tombstone.NewChecker(
|
||||||
|
tombstone.WithLogger(c.log),
|
||||||
|
tombstone.WithTombstoneSource(tombstoneSrc),
|
||||||
|
)
|
||||||
|
|
||||||
for _, opts := range c.cfgObject.cfgLocalStorage.shardOpts {
|
for _, opts := range c.cfgObject.cfgLocalStorage.shardOpts {
|
||||||
id, err := ls.AddShard(opts...)
|
id, err := ls.AddShard(append(opts, shard.WithTombstoneSource(tombstoneSource))...)
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
|
|
||||||
c.log.Info("shard attached to engine",
|
c.log.Info("shard attached to engine",
|
||||||
|
|
|
@ -318,6 +318,8 @@ func initObjectService(c *cfg) {
|
||||||
getsvc.WithKeyStorage(keyStorage),
|
getsvc.WithKeyStorage(keyStorage),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
*c.cfgObject.getSvc = *sGet // need smth better
|
||||||
|
|
||||||
sGetV2 := getsvcV2.NewService(
|
sGetV2 := getsvcV2.NewService(
|
||||||
getsvcV2.WithInternalService(sGet),
|
getsvcV2.WithInternalService(sGet),
|
||||||
getsvcV2.WithKeyStorage(keyStorage),
|
getsvcV2.WithKeyStorage(keyStorage),
|
||||||
|
|
Loading…
Reference in a new issue