[#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
}
e, err := exec.svc.currentEpochReceiver.currentEpoch()
e, err := exec.svc.currentEpochReceiver.Epoch()
switch {
default:

View file

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

View file

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

View file

@ -5,7 +5,6 @@ import (
"sync"
"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"
internalclient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/internal/client"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/util"
@ -36,10 +35,6 @@ type storageEngineWrapper struct {
type traverseGeneratorWrapper util.TraverserGenerator
type nmSrcWrapper struct {
nmSrc netmap.Source
}
func newUniqueAddressWriter(w IDListWriter) IDListWriter {
return &uniqueIDWriter{
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) {
return (*util.TraverserGenerator)(e).GenerateTraverser(cnr, nil, epoch)
}
func (n *nmSrcWrapper) currentEpoch() (uint64, error) {
return n.nmSrc.Epoch()
}