[#647] objsvc/search: Remove netmap.Source wrapper

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-08-24 20:54:29 +03:00
parent c9e3c9956e
commit ba58144de1
4 changed files with 6 additions and 17 deletions

View file

@ -74,7 +74,7 @@ func (exec *execCtx) initEpoch() bool {
return true return true
} }
e, err := exec.svc.currentEpochReceiver.currentEpoch() e, err := exec.svc.currentEpochReceiver.Epoch()
switch { switch {
default: default:

View file

@ -56,7 +56,7 @@ type simpleIDWriter struct {
type testEpochReceiver uint64 type testEpochReceiver uint64
func (e testEpochReceiver) currentEpoch() (uint64, error) { func (e testEpochReceiver) Epoch() (uint64, error) {
return uint64(e), nil return uint64(e), nil
} }

View file

@ -49,7 +49,7 @@ type cfg struct {
} }
currentEpochReceiver interface { currentEpochReceiver interface {
currentEpoch() (uint64, error) Epoch() (uint64, error)
} }
keyStore *util.KeyStorage keyStore *util.KeyStorage
@ -72,9 +72,7 @@ func New(e *engine.StorageEngine,
storage: e, storage: e,
}, },
traverserGenerator: (*traverseGeneratorWrapper)(tg), traverserGenerator: (*traverseGeneratorWrapper)(tg),
currentEpochReceiver: &nmSrcWrapper{ currentEpochReceiver: ns,
nmSrc: ns,
},
keyStore: ks, keyStore: ks,
} }

View file

@ -5,7 +5,6 @@ import (
"sync" "sync"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap"
"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"
@ -36,10 +35,6 @@ type storageEngineWrapper struct {
type traverseGeneratorWrapper util.TraverserGenerator type traverseGeneratorWrapper util.TraverserGenerator
type nmSrcWrapper struct {
nmSrc netmap.Source
}
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{}),
@ -143,7 +138,3 @@ func idsFromAddresses(addrs []oid.Address) []oid.ID {
func (e *traverseGeneratorWrapper) generateTraverser(cnr cid.ID, epoch uint64) (*placement.Traverser, error) { func (e *traverseGeneratorWrapper) generateTraverser(cnr cid.ID, epoch uint64) (*placement.Traverser, error) {
return (*util.TraverserGenerator)(e).GenerateTraverser(cnr, nil, epoch) return (*util.TraverserGenerator)(e).GenerateTraverser(cnr, nil, epoch)
} }
func (n *nmSrcWrapper) currentEpoch() (uint64, error) {
return n.nmSrc.Epoch()
}