Documentation ¶
Overview ¶
Package descendalloc implements an ipfscluster.util.Allocator returns allocations based on sorting the metrics in descending order. Thus, peers with largest metrics are first in the list. This allocator can be used with a number of informers, as long as they provide a numeric metric value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DescendAllocator ¶
type DescendAllocator struct{}
DescendAllocator extends the SimpleAllocator
func NewAllocator ¶
func NewAllocator() DescendAllocator
NewAllocator returns an initialized DescendAllocator
func (DescendAllocator) Allocate ¶
func (alloc DescendAllocator) Allocate(c *cid.Cid, current, candidates map[peer.ID]api.Metric) ([]peer.ID, error)
Allocate returns where to allocate a pin request based on metrics which carry a numeric value such as "used disk". We do not pay attention to the metrics of the currently allocated peers and we just sort the candidates based on their metric values (largest to smallest).
func (DescendAllocator) SetClient ¶
func (alloc DescendAllocator) SetClient(c *rpc.Client)
SetClient does nothing in this allocator
func (DescendAllocator) Shutdown ¶
func (alloc DescendAllocator) Shutdown() error
Shutdown does nothing in this allocator