Documentation ¶
Index ¶
- Constants
- Variables
- func FormatIPv4(ipv4 uint32) string
- func GenCircularGraphPair(k, r int) (*Graph, *Graph)
- func MustParseIPv4(host string) uint32
- func PackIPv4(ip net.IP) uint32
- func ParseIPv4(host string) (uint32, error)
- type Addr
- type Cluster
- type Graph
- type HostList
- type HostSpec
- type Interval
- type NetAddr
- type Node
- type PeerID
- type PeerList
- func (pl PeerList) Bytes() []byte
- func (pl PeerList) Clone() PeerList
- func (pl PeerList) Contains(p PeerID) bool
- func (pl PeerList) DebugString() string
- func (pl PeerList) Diff(ql PeerList) (PeerList, PeerList)
- func (pl PeerList) Disjoint(ql PeerList) bool
- func (pl PeerList) Eq(ql PeerList) bool
- func (pl PeerList) Intersection(ql PeerList) PeerList
- func (pl PeerList) LocalRank(q PeerID) (int, bool)
- func (pl PeerList) On(host uint32) PeerList
- func (pl PeerList) Rank(q PeerID) (int, bool)
- func (pl PeerList) Select(ranks []int) PeerList
- func (pl PeerList) Set() map[PeerID]struct{}
- func (pl PeerList) String() string
- type PortRange
- type Vertices
Constants ¶
View Source
const DefaultRunnerPort = uint16(38080)
Variables ¶
View Source
var DefaultHostList = HostList{ { IPv4: MustParseIPv4(`127.0.0.1`), Slots: runtime.NumCPU(), PublicAddr: `127.0.0.1`, }, }
View Source
var DefaultPortRange = PortRange{
Begin: 10000,
End: 11000,
}
View Source
var ErrInvalidHostSpec = errors.New("Invalid HostSpec")
View Source
var ErrNoEnoughCapacity = errors.New("no enough capacity")
Functions ¶
func FormatIPv4 ¶
func GenCircularGraphPair ¶
func MustParseIPv4 ¶
Types ¶
type Cluster ¶ added in v0.2.2
func (Cluster) DebugString ¶ added in v0.2.2
type Graph ¶
type Graph struct {
Nodes []Node
}
func GenBinaryTree ¶
func GenBinaryTreeStar ¶
func GenDefaultReduceGraph ¶
func GenMultiBinaryTreeStar ¶ added in v0.2.1
func GenStarBcastGraph ¶
GenStarBcastGraph generates a star shape graph with k vertices and centered at vertice r (0 <= r < k)
func (*Graph) DebugString ¶ added in v0.2.2
func (Graph) IsSelfLoop ¶
type HostList ¶
type HostList []HostSpec
func ParseHostList ¶
func (HostList) GenPeerList ¶
func (HostList) GenRunnerList ¶ added in v0.2.2
type Interval ¶
Interval represents the interval of integers [Begin, End)
func EvenPartition ¶
EvenPartition parts an Interval into k parts such that the length of each part differ at most 1
type PeerID ¶
type PeerID NetAddr
PeerID is the unique identifier of a peer.
func ParsePeerID ¶ added in v0.2.2
func (PeerID) ColocatedWith ¶
func (PeerID) ListenAddr ¶ added in v0.2.2
type PeerList ¶
type PeerList []PeerID
PeerList is an ordered list of PeerIDs
func ParsePeerList ¶ added in v0.2.2
func (PeerList) DebugString ¶ added in v0.2.2
func (PeerList) Intersection ¶ added in v0.2.2
Click to show internal directories.
Click to hide internal directories.