forked from TrueCloudLab/frostfs-node
[#1131] *: Adopt SDK changes
`object.Address` has been moved to `object/address` `object.ID` has been moved to `object/id` Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
1c821d6c36
commit
1667ec9e6d
139 changed files with 652 additions and 562 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/netmap"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
oidSDK "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/storagegroup"
|
||||
"go.uber.org/atomic"
|
||||
"go.uber.org/zap"
|
||||
|
@ -25,7 +26,7 @@ type Context struct {
|
|||
report *audit.Report
|
||||
|
||||
sgMembersMtx sync.RWMutex
|
||||
sgMembersCache map[int][]*object.ID
|
||||
sgMembersCache map[int][]*oidSDK.ID
|
||||
|
||||
placementMtx sync.Mutex
|
||||
placementCache map[string][]netmap.Nodes
|
||||
|
@ -56,7 +57,7 @@ type pairMemberInfo struct {
|
|||
type gamePair struct {
|
||||
n1, n2 *netmap.Node
|
||||
|
||||
id *object.ID
|
||||
id *oidSDK.ID
|
||||
|
||||
rn1, rn2 []*object.Range
|
||||
|
||||
|
@ -84,14 +85,14 @@ type ContextPrm struct {
|
|||
// component of communication with container nodes.
|
||||
type ContainerCommunicator interface {
|
||||
// Must return storage group structure stored in object from container.
|
||||
GetSG(*audit.Task, *object.ID) (*storagegroup.StorageGroup, error)
|
||||
GetSG(*audit.Task, *oidSDK.ID) (*storagegroup.StorageGroup, error)
|
||||
|
||||
// Must return object header from the container node.
|
||||
GetHeader(*audit.Task, *netmap.Node, *object.ID, bool) (*object.Object, error)
|
||||
GetHeader(*audit.Task, *netmap.Node, *oidSDK.ID, bool) (*object.Object, error)
|
||||
|
||||
// Must return homomorphic Tillich-Zemor hash of payload range of the
|
||||
// object stored in container node.
|
||||
GetRangeHash(*audit.Task, *netmap.Node, *object.ID, *object.Range) ([]byte, error)
|
||||
GetRangeHash(*audit.Task, *netmap.Node, *oidSDK.ID, *object.Range) ([]byte, error)
|
||||
}
|
||||
|
||||
// NewContext creates, initializes and returns Context.
|
||||
|
@ -157,7 +158,7 @@ func (c *Context) containerID() *cid.ID {
|
|||
func (c *Context) init() {
|
||||
c.report = audit.NewReport(c.containerID())
|
||||
|
||||
c.sgMembersCache = make(map[int][]*object.ID)
|
||||
c.sgMembersCache = make(map[int][]*oidSDK.ID)
|
||||
|
||||
c.placementCache = make(map[string][]netmap.Nodes)
|
||||
|
||||
|
@ -199,7 +200,7 @@ func (c *Context) writeReport() {
|
|||
}
|
||||
}
|
||||
|
||||
func (c *Context) buildPlacement(id *object.ID) ([]netmap.Nodes, error) {
|
||||
func (c *Context) buildPlacement(id *oidSDK.ID) ([]netmap.Nodes, error) {
|
||||
c.placementMtx.Lock()
|
||||
defer c.placementMtx.Unlock()
|
||||
|
||||
|
@ -223,7 +224,7 @@ func (c *Context) buildPlacement(id *object.ID) ([]netmap.Nodes, error) {
|
|||
return nn, nil
|
||||
}
|
||||
|
||||
func (c *Context) objectSize(id *object.ID) uint64 {
|
||||
func (c *Context) objectSize(id *oidSDK.ID) uint64 {
|
||||
c.headMtx.RLock()
|
||||
defer c.headMtx.RUnlock()
|
||||
|
||||
|
@ -236,7 +237,7 @@ func (c *Context) objectSize(id *object.ID) uint64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (c *Context) objectHomoHash(id *object.ID) []byte {
|
||||
func (c *Context) objectHomoHash(id *oidSDK.ID) []byte {
|
||||
c.headMtx.RLock()
|
||||
defer c.headMtx.RUnlock()
|
||||
|
||||
|
@ -263,7 +264,7 @@ func (c *Context) updateHeadResponses(hdr *object.Object) {
|
|||
}
|
||||
}
|
||||
|
||||
func (c *Context) updateSGInfo(ind int, members []*object.ID) {
|
||||
func (c *Context) updateSGInfo(ind int, members []*oidSDK.ID) {
|
||||
c.sgMembersMtx.Lock()
|
||||
defer c.sgMembersMtx.Unlock()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue