placement

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildObjectPlacement added in v0.14.0

func BuildObjectPlacement(nm *netmapSDK.NetMap, cnrNodes [][]netmapSDK.NodeInfo, id *oid.ID) ([][]netmapSDK.NodeInfo, error)

func FlattenNodes added in v0.14.0

func FlattenNodes(ns [][]netmapSDK.NodeInfo) []netmapSDK.NodeInfo

FlattenNodes appends each row to the flat list.

Types

type Builder added in v0.12.0

type Builder interface {
	// BuildPlacement returns the list of placement vectors
	// for object according to the placement policy.
	//
	// Must return all container nodes if object identifier
	// is nil.
	BuildPlacement(cid.ID, *oid.ID, netmap.PlacementPolicy) ([][]netmap.NodeInfo, error)
}

Builder is an interface of the object placement vector builder.

func NewNetworkMapBuilder added in v0.12.0

func NewNetworkMapBuilder(nm *netmapSDK.NetMap) Builder

func NewNetworkMapSourceBuilder added in v0.12.0

func NewNetworkMapSourceBuilder(nmSrc netmap.Source) Builder

type Node added in v0.25.0

type Node struct {
	// contains filtered or unexported fields
}

Node is a descriptor of storage node with information required for intra-container communication.

func (Node) Addresses added in v0.25.0

func (x Node) Addresses() network.AddressGroup

Addresses returns group of network addresses.

func (Node) ExternalAddresses added in v0.33.0

func (x Node) ExternalAddresses() network.AddressGroup

ExternalAddresses returns group of network addresses.

func (Node) PublicKey added in v0.26.0

func (x Node) PublicKey() []byte

PublicKey returns public key in a binary format. Should not be mutated.

type Option added in v0.12.0

type Option func(*cfg)

Option represents placement traverser option.

func ForContainer added in v0.12.0

func ForContainer(cnr container.Container) Option

ForContainer is a traversal container setting option.

func ForObject added in v0.12.0

func ForObject(id oid.ID) Option

ForObject is a processing object setting option.

func SuccessAfter added in v0.12.0

func SuccessAfter(v uint32) Option

SuccessAfter is a flat success number setting option.

Option has no effect if the number is not positive.

func UseBuilder added in v0.12.0

func UseBuilder(b Builder) Option

UseBuilder is a placement builder setting option.

Overlaps UseNetworkMap option.

func WithCopiesNumber added in v0.39.0

func WithCopiesNumber(cn uint32) Option

WithCopiesNumber defines minimal copies number for operation to be succeeded.

func WithoutSuccessTracking added in v0.12.0

func WithoutSuccessTracking() Option

WithoutSuccessTracking disables success tracking in traversal.

type Traverser added in v0.12.0

type Traverser struct {
	// contains filtered or unexported fields
}

Traverser represents utility for controlling traversal of object placement vectors.

func NewTraverser added in v0.12.0

func NewTraverser(opts ...Option) (*Traverser, error)

NewTraverser creates, initializes with options and returns Traverser instance.

func (*Traverser) Next added in v0.12.0

func (t *Traverser) Next() []Node

Next returns next unprocessed address of the object placement.

Returns nil if no nodes left or traversal operation succeeded.

func (*Traverser) SubmitSuccess added in v0.12.0

func (t *Traverser) SubmitSuccess()

SubmitSuccess writes single succeeded node operation.

func (*Traverser) Success added in v0.12.0

func (t *Traverser) Success() bool

Success returns true if traversal operation succeeded.

Jump to

Keyboard shortcuts

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