2021-10-27 10:00:35 +00:00
|
|
|
/*
|
2022-06-07 08:25:34 +00:00
|
|
|
Package netmap provides functionality for working with information about the
|
2022-12-29 10:46:18 +00:00
|
|
|
FrostFS network, primarily a layer of storage nodes.
|
2022-06-07 08:25:34 +00:00
|
|
|
|
2022-12-29 10:46:18 +00:00
|
|
|
The package concentrates all the characteristics of FrostFS networks.
|
2022-06-07 08:25:34 +00:00
|
|
|
|
2022-12-29 10:46:18 +00:00
|
|
|
NetMap represents FrostFS network map - one of the main technologies used to
|
2022-06-07 08:25:34 +00:00
|
|
|
store data in the system. It is composed of information about all storage nodes
|
|
|
|
(NodeInfo type) in a particular network. NetMap methods allow you to impose
|
|
|
|
container storage policies (PlacementPolicy type) on a fixed composition of
|
|
|
|
nodes for selecting nodes corresponding to the placement rules chosen by the
|
|
|
|
container creator.
|
|
|
|
|
|
|
|
NetworkInfo type is dedicated to descriptive characterization of network state
|
|
|
|
and settings.
|
|
|
|
|
2022-12-29 10:46:18 +00:00
|
|
|
Instances can be also used to process FrostFS API V2 protocol messages
|
2023-03-07 11:20:03 +00:00
|
|
|
(see neo.fs.v2.netmap package in https://git.frostfs.info/TrueCloudLab/frostfs-api).
|
2022-06-07 08:25:34 +00:00
|
|
|
|
|
|
|
On client side:
|
2022-08-24 14:17:40 +00:00
|
|
|
|
2024-10-07 14:20:25 +00:00
|
|
|
import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap"
|
2022-06-07 08:25:34 +00:00
|
|
|
|
|
|
|
var msg netmap.NodeInfo
|
2022-06-14 14:27:51 +00:00
|
|
|
info.WriteToV2(&msg)
|
2022-06-07 08:25:34 +00:00
|
|
|
|
|
|
|
// send msg
|
|
|
|
|
|
|
|
On server side:
|
2022-08-24 14:17:40 +00:00
|
|
|
|
2022-06-07 08:25:34 +00:00
|
|
|
// recv msg
|
|
|
|
|
2022-06-14 14:27:51 +00:00
|
|
|
var info NodeInfo
|
2022-06-07 08:25:34 +00:00
|
|
|
|
|
|
|
err := info.ReadFromV2(msg)
|
|
|
|
// ...
|
|
|
|
|
2022-06-14 14:27:51 +00:00
|
|
|
// process info
|
2022-06-07 08:25:34 +00:00
|
|
|
|
|
|
|
Using package types in an application is recommended to potentially work with
|
|
|
|
different protocol versions with which these types are compatible.
|
2021-10-27 10:00:35 +00:00
|
|
|
*/
|
|
|
|
package netmap
|