forked from TrueCloudLab/frostfs-node
[#647] objsvc/search: Remove TraverserGenerator wrapper
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
ba58144de1
commit
56f841b022
4 changed files with 4 additions and 12 deletions
|
@ -93,7 +93,7 @@ func (exec *execCtx) initEpoch() 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 {
|
||||
default:
|
||||
|
|
|
@ -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(
|
||||
placement.ForContainer(g.c),
|
||||
placement.UseBuilder(g.b[epoch]),
|
||||
|
|
|
@ -45,7 +45,7 @@ type cfg struct {
|
|||
}
|
||||
|
||||
traverserGenerator interface {
|
||||
generateTraverser(cid.ID, uint64) (*placement.Traverser, error)
|
||||
GenerateTraverser(cid.ID, *oid.ID, uint64) (*placement.Traverser, error)
|
||||
}
|
||||
|
||||
currentEpochReceiver interface {
|
||||
|
@ -71,7 +71,7 @@ func New(e *engine.StorageEngine,
|
|||
localStorage: &storageEngineWrapper{
|
||||
storage: e,
|
||||
},
|
||||
traverserGenerator: (*traverseGeneratorWrapper)(tg),
|
||||
traverserGenerator: tg,
|
||||
currentEpochReceiver: ns,
|
||||
keyStore: ks,
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
|
||||
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_manager/placement"
|
||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
)
|
||||
|
||||
|
@ -33,8 +31,6 @@ type storageEngineWrapper struct {
|
|||
storage *engine.StorageEngine
|
||||
}
|
||||
|
||||
type traverseGeneratorWrapper util.TraverserGenerator
|
||||
|
||||
func newUniqueAddressWriter(w IDListWriter) IDListWriter {
|
||||
return &uniqueIDWriter{
|
||||
written: make(map[oid.ID]struct{}),
|
||||
|
@ -134,7 +130,3 @@ func idsFromAddresses(addrs []oid.Address) []oid.ID {
|
|||
|
||||
return ids
|
||||
}
|
||||
|
||||
func (e *traverseGeneratorWrapper) generateTraverser(cnr cid.ID, epoch uint64) (*placement.Traverser, error) {
|
||||
return (*util.TraverserGenerator)(e).GenerateTraverser(cnr, nil, epoch)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue