alive

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alive

type Alive struct {
	// contains filtered or unexported fields
}

Function: Alive is used to update datanode's alived status. Check is datanode alived. Give suitable addresses of datanodes to stored new filekeys.

func NewAlive

func NewAlive(expired int) *Alive

func (*Alive) IsAlive

func (a *Alive) IsAlive(addr string) bool

Check if datanode is alived.

func (*Alive) LoadBalance added in v1.0.0

func (a *Alive) LoadBalance(n int) ([]string, error)

LoadBalance: sorted by the capacity of datanode. Perfer datanodes with small cap and addresses of returns are unique. Input how many datanode should be returned. But it also depends on how many alived datanodes I have. Return a serious of datanode to stroed related file.

func (*Alive) Update

func (a *Alive) Update(addr string, cap int64)

Update datanode time. (keep alive) If datanode is not register before, then create it in list and map.

Jump to

Keyboard shortcuts

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