forked from TrueCloudLab/frostfs-node
[#1402] ir: Move GetSG
interface
`auditor` does not need to request SG: processor will fetch that info before audit context initialization. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
6370c2e160
commit
7864959d0c
4 changed files with 25 additions and 20 deletions
|
@ -13,7 +13,9 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/audit"
|
||||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/netmap"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
storagegroupSDK "github.com/nspcc-dev/neofs-sdk-go/storagegroup"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -97,12 +99,27 @@ func (x *SearchSGDst) WriteIDList(ids []oid.ID) {
|
|||
x.ids = ids
|
||||
}
|
||||
|
||||
// GetSGPrm groups parameter of GetSG operation.
|
||||
type GetSGPrm struct {
|
||||
Context context.Context
|
||||
|
||||
OID oid.ID
|
||||
CID cid.ID
|
||||
|
||||
NetMap netmap.NetMap
|
||||
Container [][]netmap.NodeInfo
|
||||
}
|
||||
|
||||
// SGSource is a storage group information source interface.
|
||||
type SGSource interface {
|
||||
// Lists storage group objects in the container. Formed list must be written to destination.
|
||||
// ListSG must list storage group objects in the container. Formed list must be written to destination.
|
||||
//
|
||||
// Must return any error encountered which did not allow to form the list.
|
||||
ListSG(*SearchSGDst, SearchSGPrm) error
|
||||
|
||||
// GetSG must return storage group object for the provided CID, OID,
|
||||
// container and netmap state.
|
||||
GetSG(GetSGPrm) (*storagegroupSDK.StorageGroup, error)
|
||||
}
|
||||
|
||||
type epochAuditReporter struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue