Documentation
¶
Index ¶
- Variables
- type Address
- type CID
- type Component
- type FilterRule
- type Graph
- type Key
- type NetMap
- type Object
- type ObjectID
- type Params
- type PlacementWrapper
- func (v PlacementWrapper) ContainerNodes(ctx context.Context, cid CID) ([]multiaddr.Multiaddr, error)
- func (v PlacementWrapper) ContainerNodesInfo(ctx context.Context, cid CID, prev int) ([]netmapcore.Info, error)
- func (v PlacementWrapper) Epoch() uint64
- func (v PlacementWrapper) GetNodes(ctx context.Context, addr Address, usePreviousNetMap bool, ...) ([]multiaddr.Multiaddr, error)
- func (v PlacementWrapper) IsContainerNode(ctx context.Context, addr multiaddr.Multiaddr, cid CID, previousNetMap bool) (bool, error)
- type QueryOption
- type QueryOptions
- type SGID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyNodes when container doesn't contains any nodes ErrEmptyNodes = errors.New("container doesn't contains nodes") // ErrNodesBucketOmitted when in PlacementRule, Selector has not NodesBucket ErrNodesBucketOmitted = errors.New("nodes-bucket is omitted") // ErrEmptyContainer when GetMaxSelection or GetSelection returns empty result ErrEmptyContainer = errors.New("could not get container, it's empty") )
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component interface { NetworkState() *bootstrap.SpreadMap Neighbours(seed, epoch uint64, full bool) []peers.ID Update(epoch uint64, nm *netmapcore.NetMap) error Query(ctx context.Context, opts ...QueryOption) (Graph, error) }
Component is interface of placement service
type FilterRule ¶
FilterRule bucket callback handler
type Graph ¶
type Graph interface { Filter(rule FilterRule) Graph Exclude(list []multiaddr.Multiaddr) Graph NodeList() ([]multiaddr.Multiaddr, error) NodeInfo() ([]netmapcore.Info, error) }
Graph is result of request to Placement-component
func ContainerGraph ¶
func ContainerGraph(nm *NetMap, rule *libnetmap.PlacementRule, ignore []uint32, cid refs.CID) (Graph, error)
ContainerGraph applies the placement rules to network map and returns container graph.
type Params ¶
type Params struct { Log *zap.Logger Netmap *NetMap Peerstore peers.Store Fetcher storage.Storage ChronologyDuration uint64 // storing number of past epochs states }
Params to create Placement component
type PlacementWrapper ¶
type PlacementWrapper struct {
// contains filtered or unexported fields
}
func NewObjectPlacer ¶
func NewObjectPlacer(pl Component) (*PlacementWrapper, error)
NewObjectPlacer wraps Component and returns ObjectPlacer interface.
func (PlacementWrapper) ContainerNodes ¶
func (v PlacementWrapper) ContainerNodes(ctx context.Context, cid CID) ([]multiaddr.Multiaddr, error)
func (PlacementWrapper) ContainerNodesInfo ¶
func (v PlacementWrapper) ContainerNodesInfo(ctx context.Context, cid CID, prev int) ([]netmapcore.Info, error)
func (PlacementWrapper) Epoch ¶
func (v PlacementWrapper) Epoch() uint64
func (PlacementWrapper) IsContainerNode ¶
type QueryOption ¶
type QueryOption func(*QueryOptions)
QueryOption settings closure
func ExcludeNodes ¶
func ExcludeNodes(list []multiaddr.Multiaddr) QueryOption
ExcludeNodes to ignore some nodes.
type QueryOptions ¶
QueryOptions for query request
Click to show internal directories.
Click to hide internal directories.