[#1402] pkg: Move SGSource to the core directory

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-07-01 21:16:28 +03:00 committed by fyrchik
parent 27304455bf
commit ec07fda97b
4 changed files with 66 additions and 78 deletions

View file

@ -7,6 +7,7 @@ import (
clientcore "github.com/nspcc-dev/neofs-node/pkg/core/client"
netmapcore "github.com/nspcc-dev/neofs-node/pkg/core/netmap"
"github.com/nspcc-dev/neofs-node/pkg/core/storagegroup"
cntClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/container"
"github.com/nspcc-dev/neofs-node/pkg/services/audit"
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement"
@ -126,10 +127,10 @@ func (ap *Processor) findStorageGroups(cnr cid.ID, shuffled netmapcore.Nodes) []
var (
info clientcore.NodeInfo
prm SearchSGPrm
prm storagegroup.SearchSGPrm
)
prm.id = cnr
prm.Container = cnr
for i := range shuffled { // consider iterating over some part of container
log := ap.log.With(
@ -148,10 +149,10 @@ func (ap *Processor) findStorageGroups(cnr cid.ID, shuffled netmapcore.Nodes) []
ctx, cancel := context.WithTimeout(context.Background(), ap.searchTimeout)
prm.ctx = ctx
prm.info = info
prm.Context = ctx
prm.NodeInfo = info
var dst SearchSGDst
var dst storagegroup.SearchSGDst
err = ap.sgSrc.ListSG(&dst, prm)
@ -162,7 +163,7 @@ func (ap *Processor) findStorageGroups(cnr cid.ID, shuffled netmapcore.Nodes) []
continue
}
sg = append(sg, dst.ids...)
sg = append(sg, dst.Objects...)
break // we found storage groups, so break loop
}
@ -174,7 +175,7 @@ func (ap *Processor) filterExpiredSG(cid cid.ID, sgIDs []oid.ID,
cnr [][]netmap.NodeInfo, nm netmap.NetMap) map[oid.ID]storagegroupSDK.StorageGroup {
sgs := make(map[oid.ID]storagegroupSDK.StorageGroup, len(sgIDs))
var getSGPrm GetSGPrm
var getSGPrm storagegroup.GetSGPrm
getSGPrm.CID = cid
getSGPrm.Container = cnr
getSGPrm.NetMap = nm