placement

package
v0.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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) 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

func (s *Service) GetContainerPlacement(cnrID cid.ID) (Placement, error)

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.

func (*Service) SelectContainerNodes

func (s *Service) SelectContainerNodes(cnrID cid.ID) ([][]netmap.NodeInfo, []uint, []iec.Rule, error)

SelectContainerNodes applies the storage policy of a specified container to the current network state and returns the result.

func (*Service) SortContainerPlacementForObject

func (s *Service) SortContainerPlacementForObject(cnrID cid.ID, p Placement, obj oid.ID) ([][]netmap.NodeInfo, error)

SortContainerPlacementForObject sorts provided current-epoch placement for an object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL