Documentation
¶
Index ¶
- type Placement
- type Service
- func (s *Service) ForEachContainerNodePublicKey(cnrID cid.ID, f func(pubKey []byte) bool) error
- func (s *Service) ForEachContainerNodePublicKeyInLastTwoEpochs(cnrID cid.ID, f func(pubKey []byte) bool) error
- func (s *Service) GetContainerPlacement(cnrID cid.ID) (Placement, error)
- func (s *Service) GetNodesForObject(addr oid.Address) ([][]netmap.NodeInfo, []uint, []iec.Rule, error)
- func (s *Service) SelectContainerNodes(cnrID cid.ID) ([][]netmap.NodeInfo, []uint, []iec.Rule, error)
- func (s *Service) SortContainerPlacementForObject(cnrID cid.ID, p Placement, obj oid.ID) ([][]netmap.NodeInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Placement ¶
type Placement struct {
Epoch uint64
NodeSets [][]netmap.NodeInfo
RepCounts []uint
ECRules []iec.Rule
}
Placement stores storage policy application result for a particular container and network map.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service applies container storage policies to NeoFS network maps and caches the results.
func New ¶
func New(containers containercore.Source, network netmapcore.Source) (*Service, error)
func (*Service) ForEachContainerNodePublicKey ¶ added in v0.56.0
ForEachContainerNodePublicKey passes binary-encoded public key of each node matching the referenced container's storage policy at the current epoch into f. When f returns false, nil is returned instantly.
func (*Service) ForEachContainerNodePublicKeyInLastTwoEpochs ¶
func (s *Service) ForEachContainerNodePublicKeyInLastTwoEpochs(cnrID cid.ID, f func(pubKey []byte) bool) error
ForEachContainerNodePublicKeyInLastTwoEpochs passes binary-encoded public key of each node match the referenced container's storage policy at two latest epochs into f. When f returns false, nil is returned instantly.
func (*Service) GetContainerPlacement ¶
GetContainerPlacement returns container placement for the current epoch.
func (*Service) GetNodesForObject ¶
func (s *Service) GetNodesForObject(addr oid.Address) ([][]netmap.NodeInfo, []uint, []iec.Rule, error)
GetNodesForObject reads storage policy of the referenced container from the underlying container storage, reads network map at the specified epoch from the underlying storage, applies the storage policy to it and returns sorted lists of selected storage nodes along with the per-list numbers of primary object holders. Resulting slices must not be changed.