ascendalloc

package
v0.0.0-...-6646f2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ascendalloc implements an ipfscluster.PinAllocator, which returns allocations based on sorting the metrics in ascending order. Thus, peers with smallest 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 AscendAllocator

type AscendAllocator struct{}

AscendAllocator extends the SimpleAllocator

func NewAllocator

func NewAllocator() AscendAllocator

NewAllocator returns an initialized AscendAllocator

func (AscendAllocator) Allocate

func (alloc AscendAllocator) Allocate(c cid.Cid, current,
	candidates, priority 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 (smallest to largest).

func (AscendAllocator) SetClient

func (alloc AscendAllocator) SetClient(c *rpc.Client)

SetClient does nothing in this allocator

func (AscendAllocator) Shutdown

func (alloc AscendAllocator) Shutdown() error

Shutdown does nothing in this allocator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL