Documentation ¶
Index ¶
- func BuildObjectPlacement(nm *netmapSDK.NetMap, cnrNodes [][]netmapSDK.NodeInfo, id *oid.ID) ([][]netmapSDK.NodeInfo, error)
- func FlattenNodes(ns [][]netmapSDK.NodeInfo) []netmapSDK.NodeInfo
- type Builder
- type ContainerNodesCache
- type Metric
- type Node
- type NodeState
- type Option
- func ForContainer(cnr container.Container) Option
- func ForObject(id oid.ID) Option
- func ResetSuccessAfter() Option
- func SuccessAfter(v uint32) Option
- func UseBuilder(b Builder) Option
- func WithCopyNumbers(v []uint32) Option
- func WithNodeState(s NodeState) Option
- func WithPriorityMetrics(m []Metric) Option
- func WithoutSuccessTracking() Option
- type Traverser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildObjectPlacement ¶
Types ¶
type Builder ¶
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 ¶
type ContainerNodesCache ¶ added in v0.42.0
type ContainerNodesCache struct {
// contains filtered or unexported fields
}
ContainerNodesCache caches results of ContainerNodes() invocation between epochs.
func NewContainerNodesCache ¶ added in v0.42.0
func NewContainerNodesCache(size int) *ContainerNodesCache
NewContainerNodesCache creates new cache which saves the result of the ContainerNodes() invocations. If size is <= 0, defaultContainerCacheSize (10) is used.
func (*ContainerNodesCache) ContainerNodes ¶ added in v0.42.0
func (c *ContainerNodesCache) ContainerNodes(nm *netmapSDK.NetMap, cnr cid.ID, p netmapSDK.PlacementPolicy) ([][]netmapSDK.NodeInfo, error)
ContainerNodes returns the result of nm.ContainerNodes(), possibly from the cache.
type Metric ¶ added in v0.44.0
func NewAttributeMetric ¶ added in v0.44.0
func ParseMetric ¶ added in v0.44.0
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a descriptor of storage node with information required for intra-container communication.
func NewNode ¶ added in v0.38.0
func NewNode(addresses network.AddressGroup, externalAddresses network.AddressGroup, key []byte) Node
NewNode creates new Node.
func (Node) Addresses ¶
func (x Node) Addresses() network.AddressGroup
Addresses returns group of network addresses.
func (Node) ExternalAddresses ¶
func (x Node) ExternalAddresses() network.AddressGroup
ExternalAddresses returns group of network addresses.
type Option ¶
type Option func(*cfg)
Option represents placement traverser option.
func ForContainer ¶
ForContainer is a traversal container setting option.
func ResetSuccessAfter ¶ added in v0.42.14
func ResetSuccessAfter() Option
ResetSuccessAfter resets flat success number setting option.
func SuccessAfter ¶
SuccessAfter is a flat success number setting option.
Option has no effect if the number is not positive.
func WithCopyNumbers ¶ added in v0.37.0
func WithNodeState ¶ added in v0.44.0
WithNodeState provide state of the current node.
func WithPriorityMetrics ¶ added in v0.44.0
WithPriorityMetrics use provided priority metrics to sort nodes.
func WithoutSuccessTracking ¶
func WithoutSuccessTracking() Option
WithoutSuccessTracking disables success tracking in traversal.
type Traverser ¶
type Traverser struct {
// contains filtered or unexported fields
}
Traverser represents utility for controlling traversal of object placement vectors.
func NewTraverser ¶
NewTraverser creates, initializes with options and returns Traverser instance.
func (*Traverser) Next ¶
Next returns next unprocessed address of the object placement.
Returns nil if no nodes left or traversal operation succeeded.
func (*Traverser) SubmitSuccess ¶
func (t *Traverser) SubmitSuccess()
SubmitSuccess writes single succeeded node operation.