forked from TrueCloudLab/frostfs-sdk-go
[#4] Rename NeoFS mentions in comments and method names
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
b204a62da1
commit
4ff9c00de3
75 changed files with 423 additions and 423 deletions
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
Package netmap provides functionality for working with information about the
|
||||
NeoFS network, primarily a layer of storage nodes.
|
||||
FrostFS network, primarily a layer of storage nodes.
|
||||
|
||||
The package concentrates all the characteristics of NeoFS networks.
|
||||
The package concentrates all the characteristics of FrostFS networks.
|
||||
|
||||
NetMap represents NeoFS network map - one of the main technologies used to
|
||||
NetMap represents FrostFS network map - one of the main technologies used to
|
||||
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
|
||||
|
@ -14,7 +14,7 @@ container creator.
|
|||
NetworkInfo type is dedicated to descriptive characterization of network state
|
||||
and settings.
|
||||
|
||||
Instances can be also used to process NeoFS API V2 protocol messages
|
||||
Instances can be also used to process FrostFS API V2 protocol messages
|
||||
(see neo.fs.v2.netmap package in https://github.com/TrueCloudLab/frostfs-api).
|
||||
|
||||
On client side:
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"github.com/TrueCloudLab/hrw"
|
||||
)
|
||||
|
||||
// NetMap represents NeoFS network map. It includes information about all
|
||||
// storage nodes registered in NeoFS the network.
|
||||
// NetMap represents FrostFS network map. It includes information about all
|
||||
// storage nodes registered in FrostFS the network.
|
||||
//
|
||||
// NetMap is mutually compatible with github.com/TrueCloudLab/frostfs-api-go/v2/netmap.NetMap
|
||||
// message. See ReadFromV2 / WriteToV2 methods.
|
||||
|
@ -21,7 +21,7 @@ type NetMap struct {
|
|||
}
|
||||
|
||||
// ReadFromV2 reads NetMap from the netmap.NetMap message. Checks if the
|
||||
// message conforms to NeoFS API V2 protocol.
|
||||
// message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (m *NetMap) ReadFromV2(msg netmap.NetMap) error {
|
||||
|
@ -66,7 +66,7 @@ func (m NetMap) WriteToV2(msg *netmap.NetMap) {
|
|||
msg.SetEpoch(m.epoch)
|
||||
}
|
||||
|
||||
// SetNodes sets information list about all storage nodes from the NeoFS network.
|
||||
// SetNodes sets information list about all storage nodes from the FrostFS network.
|
||||
//
|
||||
// Argument MUST NOT be mutated, make a copy first.
|
||||
//
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
)
|
||||
|
||||
// NetworkInfo groups information about the NeoFS network state. Mainly used to
|
||||
// NetworkInfo groups information about the FrostFS network state. Mainly used to
|
||||
// describe the current state of the network.
|
||||
//
|
||||
// NetworkInfo is mutually compatible with github.com/TrueCloudLab/frostfs-api-go/v2/netmap.NetworkInfo
|
||||
|
@ -24,7 +24,7 @@ type NetworkInfo struct {
|
|||
|
||||
// reads NetworkInfo from netmap.NetworkInfo message. If checkFieldPresence is set,
|
||||
// returns an error on absence of any protocol-required field. Verifies format of any
|
||||
// presented field according to NeoFS API V2 protocol.
|
||||
// presented field according to FrostFS API V2 protocol.
|
||||
func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool) error {
|
||||
c := m.GetNetworkConfig()
|
||||
if checkFieldPresence && c == nil {
|
||||
|
@ -97,7 +97,7 @@ func (x *NetworkInfo) readFromV2(m netmap.NetworkInfo, checkFieldPresence bool)
|
|||
}
|
||||
|
||||
// ReadFromV2 reads NetworkInfo from the netmap.NetworkInfo message. Checks if the
|
||||
// message conforms to NeoFS API V2 protocol.
|
||||
// message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (x *NetworkInfo) ReadFromV2(m netmap.NetworkInfo) error {
|
||||
|
@ -119,7 +119,7 @@ func (x NetworkInfo) CurrentEpoch() uint64 {
|
|||
return x.m.GetCurrentEpoch()
|
||||
}
|
||||
|
||||
// SetCurrentEpoch sets current epoch of the NeoFS network.
|
||||
// SetCurrentEpoch sets current epoch of the FrostFS network.
|
||||
func (x *NetworkInfo) SetCurrentEpoch(epoch uint64) {
|
||||
x.m.SetCurrentEpoch(epoch)
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ func (x NetworkInfo) MagicNumber() uint64 {
|
|||
return x.m.GetMagicNumber()
|
||||
}
|
||||
|
||||
// SetMagicNumber sets magic number of the NeoFS Sidechain.
|
||||
// SetMagicNumber sets magic number of the FrostFS Sidechain.
|
||||
//
|
||||
// See also MagicNumber.
|
||||
func (x *NetworkInfo) SetMagicNumber(epoch uint64) {
|
||||
|
@ -143,7 +143,7 @@ func (x NetworkInfo) MsPerBlock() int64 {
|
|||
return x.m.GetMsPerBlock()
|
||||
}
|
||||
|
||||
// SetMsPerBlock sets MillisecondsPerBlock network parameter of the NeoFS Sidechain.
|
||||
// SetMsPerBlock sets MillisecondsPerBlock network parameter of the FrostFS Sidechain.
|
||||
//
|
||||
// See also MsPerBlock.
|
||||
func (x *NetworkInfo) SetMsPerBlock(v int64) {
|
||||
|
@ -203,8 +203,8 @@ func (x NetworkInfo) configValue(name string) (res []byte) {
|
|||
return
|
||||
}
|
||||
|
||||
// SetRawNetworkParameter sets named NeoFS network parameter whose value is
|
||||
// transmitted but not interpreted by the NeoFS API protocol.
|
||||
// SetRawNetworkParameter sets named FrostFS network parameter whose value is
|
||||
// transmitted but not interpreted by the FrostFS API protocol.
|
||||
//
|
||||
// Argument MUST NOT be mutated, make a copy first.
|
||||
//
|
||||
|
@ -441,8 +441,8 @@ func (x NetworkInfo) NumberOfEigenTrustIterations() uint64 {
|
|||
|
||||
const configEpochDuration = "EpochDuration"
|
||||
|
||||
// SetEpochDuration sets NeoFS epoch duration measured in number of blocks of
|
||||
// the NeoFS Sidechain.
|
||||
// SetEpochDuration sets FrostFS epoch duration measured in number of blocks of
|
||||
// the FrostFS Sidechain.
|
||||
//
|
||||
// See also EpochDuration.
|
||||
func (x *NetworkInfo) SetEpochDuration(blocks uint64) {
|
||||
|
@ -492,7 +492,7 @@ func (x NetworkInfo) MaxObjectSize() uint64 {
|
|||
|
||||
const configWithdrawalFee = "WithdrawFee"
|
||||
|
||||
// SetWithdrawalFee sets fee for withdrawals from the NeoFS accounts that
|
||||
// SetWithdrawalFee sets fee for withdrawals from the FrostFS accounts that
|
||||
// account owners pay to each Alphabet node.
|
||||
//
|
||||
// See also WithdrawalFee.
|
||||
|
|
|
@ -14,9 +14,9 @@ import (
|
|||
"github.com/TrueCloudLab/hrw"
|
||||
)
|
||||
|
||||
// NodeInfo groups information about NeoFS storage node which is reflected
|
||||
// in the NeoFS network map. Storage nodes advertise this information when
|
||||
// registering with the NeoFS network. After successful registration, information
|
||||
// NodeInfo groups information about FrostFS storage node which is reflected
|
||||
// in the FrostFS network map. Storage nodes advertise this information when
|
||||
// registering with the FrostFS network. After successful registration, information
|
||||
// about the nodes is available to all network participants to work with the network
|
||||
// map (mainly to comply with container storage policies).
|
||||
//
|
||||
|
@ -30,7 +30,7 @@ type NodeInfo struct {
|
|||
|
||||
// reads NodeInfo from netmap.NodeInfo message. If checkFieldPresence is set,
|
||||
// returns an error on absence of any protocol-required field. Verifies format of any
|
||||
// presented field according to NeoFS API V2 protocol.
|
||||
// presented field according to FrostFS API V2 protocol.
|
||||
func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error {
|
||||
var err error
|
||||
|
||||
|
@ -91,7 +91,7 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error
|
|||
}
|
||||
|
||||
// ReadFromV2 reads NodeInfo from the netmap.NodeInfo message. Checks if the
|
||||
// message conforms to NeoFS API V2 protocol.
|
||||
// message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (x *NodeInfo) ReadFromV2(m netmap.NodeInfo) error {
|
||||
|
@ -106,7 +106,7 @@ func (x NodeInfo) WriteToV2(m *netmap.NodeInfo) {
|
|||
*m = x.m
|
||||
}
|
||||
|
||||
// Marshal encodes NodeInfo into a binary format of the NeoFS API protocol
|
||||
// Marshal encodes NodeInfo into a binary format of the FrostFS API protocol
|
||||
// (Protocol Buffers with direct field order).
|
||||
//
|
||||
// See also Unmarshal.
|
||||
|
@ -117,7 +117,7 @@ func (x NodeInfo) Marshal() []byte {
|
|||
return m.StableMarshal(nil)
|
||||
}
|
||||
|
||||
// Unmarshal decodes NeoFS API protocol binary format into the NodeInfo
|
||||
// Unmarshal decodes FrostFS API protocol binary format into the NodeInfo
|
||||
// (Protocol Buffers with direct field order). Returns an error describing
|
||||
// a format violation.
|
||||
//
|
||||
|
@ -133,7 +133,7 @@ func (x *NodeInfo) Unmarshal(data []byte) error {
|
|||
return x.readFromV2(m, false)
|
||||
}
|
||||
|
||||
// MarshalJSON encodes NodeInfo into a JSON format of the NeoFS API protocol
|
||||
// MarshalJSON encodes NodeInfo into a JSON format of the FrostFS API protocol
|
||||
// (Protocol Buffers JSON).
|
||||
//
|
||||
// See also UnmarshalJSON.
|
||||
|
@ -144,7 +144,7 @@ func (x NodeInfo) MarshalJSON() ([]byte, error) {
|
|||
return m.MarshalJSON()
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes NeoFS API protocol JSON format into the NodeInfo
|
||||
// UnmarshalJSON decodes FrostFS API protocol JSON format into the NodeInfo
|
||||
// (Protocol Buffers JSON). Returns an error describing a format violation.
|
||||
//
|
||||
// See also MarshalJSON.
|
||||
|
@ -172,7 +172,7 @@ func (x *NodeInfo) SetPublicKey(key []byte) {
|
|||
// PublicKey returns value set using SetPublicKey.
|
||||
//
|
||||
// Zero NodeInfo has no public key, which is incorrect according to
|
||||
// NeoFS system requirements.
|
||||
// FrostFS system requirements.
|
||||
//
|
||||
// Return value MUST not be mutated, make a copy first.
|
||||
func (x NodeInfo) PublicKey() []byte {
|
||||
|
@ -186,7 +186,7 @@ func StringifyPublicKey(node NodeInfo) string {
|
|||
|
||||
// SetNetworkEndpoints sets list to the announced node's network endpoints.
|
||||
// Node MUSt have at least one announced endpoint. List MUST be unique.
|
||||
// Endpoints are used for communication with the storage node within NeoFS
|
||||
// Endpoints are used for communication with the storage node within FrostFS
|
||||
// network. It is expected that node serves storage node services on these
|
||||
// endpoints (it also adds a wait on their network availability).
|
||||
//
|
||||
|
@ -209,7 +209,7 @@ func (x NodeInfo) NumberOfNetworkEndpoints() int {
|
|||
// MUST NOT be nil.
|
||||
//
|
||||
// Zero NodeInfo contains no endpoints which is incorrect according to
|
||||
// NeoFS system requirements.
|
||||
// FrostFS system requirements.
|
||||
//
|
||||
// See also SetNetworkEndpoints.
|
||||
func (x NodeInfo) IterateNetworkEndpoints(f func(string) bool) {
|
||||
|
@ -297,7 +297,7 @@ func (x NodeInfo) capacity() uint64 {
|
|||
const attrUNLOCODE = "UN-LOCODE"
|
||||
|
||||
// SetLOCODE specifies node's geographic location in UN/LOCODE format. Each
|
||||
// storage node MUST declare it for entrance to the NeoFS network. Node MAY
|
||||
// storage node MUST declare it for entrance to the FrostFS network. Node MAY
|
||||
// declare the code of the nearest location as needed, for example, when it is
|
||||
// impossible to unambiguously attribute the node to any location from UN/LOCODE
|
||||
// database.
|
||||
|
@ -310,7 +310,7 @@ func (x *NodeInfo) SetLOCODE(locode string) {
|
|||
// LOCODE returns node's location code set using SetLOCODE.
|
||||
//
|
||||
// Zero NodeInfo has empty location code which is invalid according to
|
||||
// NeoFS API system requirement.
|
||||
// FrostFS API system requirement.
|
||||
func (x NodeInfo) LOCODE() string {
|
||||
return x.Attribute(attrUNLOCODE)
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@ import (
|
|||
"github.com/antlr/antlr4/runtime/Go/antlr/v4"
|
||||
)
|
||||
|
||||
// PlacementPolicy declares policy to store objects in the NeoFS container.
|
||||
// PlacementPolicy declares policy to store objects in the FrostFS container.
|
||||
// Within itself, PlacementPolicy represents a set of rules to select a subset
|
||||
// of nodes from NeoFS network map - node-candidates for object storage.
|
||||
// of nodes from FrostFS network map - node-candidates for object storage.
|
||||
//
|
||||
// PlacementPolicy is mutually compatible with github.com/TrueCloudLab/frostfs-api-go/v2/netmap.PlacementPolicy
|
||||
// message. See ReadFromV2 / WriteToV2 methods.
|
||||
|
@ -57,7 +57,7 @@ func (p *PlacementPolicy) readFromV2(m netmap.PlacementPolicy, checkFieldPresenc
|
|||
return nil
|
||||
}
|
||||
|
||||
// Marshal encodes PlacementPolicy into a binary format of the NeoFS API
|
||||
// Marshal encodes PlacementPolicy into a binary format of the FrostFS API
|
||||
// protocol (Protocol Buffers with direct field order).
|
||||
//
|
||||
// See also Unmarshal.
|
||||
|
@ -68,7 +68,7 @@ func (p PlacementPolicy) Marshal() []byte {
|
|||
return m.StableMarshal(nil)
|
||||
}
|
||||
|
||||
// Unmarshal decodes NeoFS API protocol binary format into the PlacementPolicy
|
||||
// Unmarshal decodes FrostFS API protocol binary format into the PlacementPolicy
|
||||
// (Protocol Buffers with direct field order). Returns an error describing
|
||||
// a format violation.
|
||||
//
|
||||
|
@ -84,7 +84,7 @@ func (p *PlacementPolicy) Unmarshal(data []byte) error {
|
|||
return p.readFromV2(m, false)
|
||||
}
|
||||
|
||||
// MarshalJSON encodes PlacementPolicy into a JSON format of the NeoFS API
|
||||
// MarshalJSON encodes PlacementPolicy into a JSON format of the FrostFS API
|
||||
// protocol (Protocol Buffers JSON).
|
||||
//
|
||||
// See also UnmarshalJSON.
|
||||
|
@ -95,7 +95,7 @@ func (p PlacementPolicy) MarshalJSON() ([]byte, error) {
|
|||
return m.MarshalJSON()
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes NeoFS API protocol JSON format into the PlacementPolicy
|
||||
// UnmarshalJSON decodes FrostFS API protocol JSON format into the PlacementPolicy
|
||||
// (Protocol Buffers JSON). Returns an error describing a format violation.
|
||||
//
|
||||
// See also MarshalJSON.
|
||||
|
@ -111,7 +111,7 @@ func (p *PlacementPolicy) UnmarshalJSON(data []byte) error {
|
|||
}
|
||||
|
||||
// ReadFromV2 reads PlacementPolicy from the netmap.PlacementPolicy message.
|
||||
// Checks if the message conforms to NeoFS API V2 protocol.
|
||||
// Checks if the message conforms to FrostFS API V2 protocol.
|
||||
//
|
||||
// See also WriteToV2.
|
||||
func (p *PlacementPolicy) ReadFromV2(m netmap.PlacementPolicy) error {
|
||||
|
@ -188,7 +188,7 @@ func (p *PlacementPolicy) AddReplicas(rs ...ReplicaDescriptor) {
|
|||
// NumberOfReplicas returns number of replica descriptors set using AddReplicas.
|
||||
//
|
||||
// Zero PlacementPolicy has no replicas which is incorrect according to the
|
||||
// NeoFS API protocol.
|
||||
// FrostFS API protocol.
|
||||
func (p PlacementPolicy) NumberOfReplicas() int {
|
||||
return len(p.replicas)
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ func (p PlacementPolicy) ReplicaNumberByIndex(i int) uint32 {
|
|||
}
|
||||
|
||||
// SetContainerBackupFactor sets container backup factor: it controls how deep
|
||||
// NeoFS will search for nodes alternatives to include into container's nodes subset.
|
||||
// FrostFS will search for nodes alternatives to include into container's nodes subset.
|
||||
//
|
||||
// Zero PlacementPolicy has zero container backup factor.
|
||||
func (p *PlacementPolicy) SetContainerBackupFactor(f uint32) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue