[#647] objsvc/search: Remove TraverserGenerator wrapper

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-08-24 20:57:53 +03:00
parent ba58144de1
commit 56f841b022
4 changed files with 4 additions and 12 deletions

View file

@ -93,7 +93,7 @@ func (exec *execCtx) initEpoch() bool {
} }
func (exec *execCtx) generateTraverser(cnr cid.ID) (*placement.Traverser, bool) { func (exec *execCtx) generateTraverser(cnr cid.ID) (*placement.Traverser, bool) {
t, err := exec.svc.traverserGenerator.generateTraverser(cnr, exec.curProcEpoch) t, err := exec.svc.traverserGenerator.GenerateTraverser(cnr, nil, exec.curProcEpoch)
switch { switch {
default: default:

View file

@ -71,7 +71,7 @@ func newTestStorage() *testStorage {
} }
} }
func (g *testTraverserGenerator) generateTraverser(_ cid.ID, epoch uint64) (*placement.Traverser, error) { func (g *testTraverserGenerator) GenerateTraverser(_ cid.ID, _ *oid.ID, epoch uint64) (*placement.Traverser, error) {
return placement.NewTraverser( return placement.NewTraverser(
placement.ForContainer(g.c), placement.ForContainer(g.c),
placement.UseBuilder(g.b[epoch]), placement.UseBuilder(g.b[epoch]),

View file

@ -45,7 +45,7 @@ type cfg struct {
} }
traverserGenerator interface { traverserGenerator interface {
generateTraverser(cid.ID, uint64) (*placement.Traverser, error) GenerateTraverser(cid.ID, *oid.ID, uint64) (*placement.Traverser, error)
} }
currentEpochReceiver interface { currentEpochReceiver interface {
@ -71,7 +71,7 @@ func New(e *engine.StorageEngine,
localStorage: &storageEngineWrapper{ localStorage: &storageEngineWrapper{
storage: e, storage: e,
}, },
traverserGenerator: (*traverseGeneratorWrapper)(tg), traverserGenerator: tg,
currentEpochReceiver: ns, currentEpochReceiver: ns,
keyStore: ks, keyStore: ks,
} }

View file

@ -8,8 +8,6 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/internal/client" internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/internal/client"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object_manager/placement"
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
) )
@ -33,8 +31,6 @@ type storageEngineWrapper struct {
storage *engine.StorageEngine storage *engine.StorageEngine
} }
type traverseGeneratorWrapper util.TraverserGenerator
func newUniqueAddressWriter(w IDListWriter) IDListWriter { func newUniqueAddressWriter(w IDListWriter) IDListWriter {
return &uniqueIDWriter{ return &uniqueIDWriter{
written: make(map[oid.ID]struct{}), written: make(map[oid.ID]struct{}),
@ -134,7 +130,3 @@ func idsFromAddresses(addrs []oid.Address) []oid.ID {
return ids return ids
} }
func (e *traverseGeneratorWrapper) generateTraverser(cnr cid.ID, epoch uint64) (*placement.Traverser, error) {
return (*util.TraverserGenerator)(e).GenerateTraverser(cnr, nil, epoch)
}